Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnat Studio and the language server processes saturate a core for minutes with large arrays #159

Open
kevlar700 opened this issue May 24, 2023 · 5 comments
Assignees

Comments

@kevlar700
Copy link

When using GNAT Studio Continuous Release 20230501 (other versions untested) with an constant Interfaces.Unsigned_8 array containing 310,352 bytes in my case (generated by the Advanced Resource Embedder tool and the array contents copied over). I find that Gnat Studio has serious performance issues compared to vscode. vscode does take minutes like gnat studio to format the file containing the array.

@AnthonyLeonardoGracio AnthonyLeonardoGracio self-assigned this May 26, 2023
@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @kevlar700,

Could you attach the file that exhibits the issue? Also, what does trigger the performance issue? Is it tooltips, navigation, something else? If you could give more details.

@kevlar700
Copy link
Author

kevlar700 commented May 26, 2023

I couldn't attach files with extension .ads|.adb so you can find them here.
"https://github.com/kevlar700/Gnat-Studio-issue-159"

I shall try to pin point some extra information but the issues should hopefully be quite apparent if you start doing any editing in the .adb file utilising the array or try to format the .ads file. However my array formatting pretty print options currently put array components on lines by themselves.

My pretty print options are:

   package Pretty_Printer is
      for Default_Switches ("ada") use ("--call-threshold=1", "--par-threshold=1", "--vertical-enum-types", "--vertical-named-aggregates", "-W8", "-c5", "-c4");
   end Pretty_Printer;

The gnat_studio_exe process is tied up for several minutes followed by the language server upon killing gnat studio. There is a kernel log entry for the language server of overflowed sigaltsack

@kevlar700
Copy link
Author

kevlar700 commented May 26, 2023

Realising that the following was missing:

type Positive_8_Array_Data is array (Positive range <>) of Interfaces.Unsigned_8 with
Component_size => 8;

I created a project just with the trouble code and the performance issue is there but much much less and usable.

I am trying to narrow down the cause though the language_server was using 1.35 gigabytes of ram on this tiny project. Perhaps it ran out of stack on my larger project where my large projects language server normally uses less than 500 megabytes (before the addition of this array).

@kevlar700
Copy link
Author

kevlar700 commented May 26, 2023

I haven't changed anything and now the large project seems to be performing better than yesterday so long as I do not attempt to format the .ads file with the array.

Perhaps this issue should be closed or renamed to a feature request of adding multi core support to the language server and gnat studio processes or efficiency improvements to the formatter?

Edit: I just left the formatter going until completion for around twenty minutes and it failed to complete the task so I guess the issue may not just be performance.

@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @kevlar700,

We have identified an issue with the tooltips: we are trying to display all the components of the very big constant array, which makes GNAT Studio to hang. We'll fix that.

Regarding formatting, we'll open an issue internally to see what we can do.

Regards,

adacore-bot pushed a commit that referenced this issue May 29, 2023
Since it can be very slow. This a safety net: in general tooltips should
not be that big, but we have an issue with the GNATdoc extracter that
will be resolved.

For #159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants