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

First time load of project with many files very slow with "the editor has not shown up in time" errors #1612

Closed
3 tasks done
FrightRisk opened this issue Nov 1, 2022 · 5 comments · Fixed by #1649
Closed
3 tasks done
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@FrightRisk
Copy link

Describe the problem

We have a project that has 50+ .cpp and .h files. The first time you load this project, the 2.0 IDE is doing some kind of check on the files and slowly loads them one at a time in the IDE file tabs. This does not occur the next time the project is opened. The load takes several minutes. The second time through, it is still slow, but less than 30 seconds.

arduino ide boot log 5.txt

To reproduce

Go to this repo, download the project, and try to load it into the 2.0 IDE
https://github.com/DCC-EX/CommandStation-EX

Expected behavior

I would expect it to load much faster and not have a 5 second timeout for every file.

Arduino IDE version

2.02 nightly 20221030

Operating system

Windows

Operating system version

Windows 11

Additional context

boot log included above

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@FrightRisk FrightRisk added the type: imperfection Perceived defect in any part of project label Nov 1, 2022
@per1234 per1234 added the topic: code Related to content of the project itself label Nov 1, 2022
@FrightRisk
Copy link
Author

FrightRisk commented Nov 1, 2022

Can anyone explain what the load process is and why it is so much slower the first time it sees a new project? Once a hash is created for a .ino file, the IDE skips whatever check it does the first time.

Also, in order to generate logs, I need it to think the project is one it hasn't seen. I tried deleting the files in C:\users\<user name\.arduino called recent-sketches.json and recentworkspace.json, but that just clears the recent files menu. It is storing something somewhere else that knows that file was opened and processed before.

@per1234
Copy link
Contributor

per1234 commented Nov 1, 2022

Thanks for your report @FrightRisk

It is storing something somewhere else that knows that file was opened and processed before.

I already provided you with this information on your forum post:

https://forum.arduino.cc/t/how-to-clear-recent-files-list-in-2-0/1047673/7

If that isn't working for you, or if there is something you didn't understand about the information I shared, please reply on the forum thread and I'll help you out.

@kittaakos kittaakos self-assigned this Nov 4, 2022
@kittaakos
Copy link
Contributor

It seems it affects all sketches created before 2.0.1 and opened with 2.0.1 for the first time. IDE2 does not have this problem opening the same sketch for the second time.

Can somebody please confirm this?

Here is my test sketch as Errors.zip. (Original source):

  • Compile a sketch with multiple errors. Here is an example sketch:
    Errors.zip
  • Unpack the file and put it into your sketchbook (rename the folder and the main sketch file if required),
  • Open IDE2 (it opens with your last sketches or a temp one),
  • Go to File > Sketchbook and open the test sketch,
  • The first editor opens quickly, then from the second editor, every editor takes 5 sec to open,
  • Quit IDE2,
  • Open IDE2 the test sketch quickly restores.

👆 It's a bug; no question about it, but please confirm. Thank you!

@per1234
Copy link
Contributor

per1234 commented Nov 7, 2022

I confirm.


By the way, if you want an extreme example of this bug, try opening an older version of the popular Marlin 3D printer firmware sketch from before they restructured it in 2.0.0.0 by moving most of the source files under the src subfolder:

https://github.com/MarlinFirmware/Marlin/archive/refs/tags/1.1.9.1.zip

That sketch actually brings my computer to its knees and causes other applications to crash due to lack of memory.

kittaakos pushed a commit that referenced this issue Nov 7, 2022
From now on, the editor widget open promise resolution does not rely on
internal Theia events, but solely on phosphor's `isAttached`/`isVisible`
properties.
The editor widget promise resolves with the next task after a navigation
frame so that the browser can render the widget.

Closes #1612

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Nov 7, 2022
From now on, the editor widget open promise resolution does not rely on
internal Theia events but solely on @phosphor's `isAttached`/`isVisible`
properties.
The editor widget promise resolves with the next task after a navigation
frame so the browser can render the widget.

Closes #1612

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Nov 10, 2022
From now on, the editor widget open promise resolution does not rely on
internal Theia events but solely on @phosphor's `isAttached`/`isVisible`
properties.
The editor widget promise resolves with the next task after a navigation
frame so the browser can render the widget.

Closes #1612

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Nov 10, 2022
From now on, the editor widget open promise resolution does not rely on
internal Theia events but solely on @phosphor's `isAttached`/`isVisible`
properties.
The editor widget promise resolves with the next task after a navigation
frame so the browser can render the widget.

Closes #1612

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Nov 11, 2022
From now on, the editor widget open promise resolution does not rely on
internal Theia events but solely on @phosphor's `isAttached`/`isVisible`
properties.
The editor widget promise resolves with the next task after a navigation
frame so the browser can render the widget.

Closes #1612

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Nov 11, 2022
@FrightRisk
Copy link
Author

I know this is marked resolved, but I have Linux users using version 2.0.3 nightly build and it takes 3 minutes to load the project. On my Windows 11, 64bit, SSD, laptop, it takes 13 seconds (11 seconds using 1.8.9). I am using:

Version: 2.0.2
Date: 2022-11-17T11:54:56.612Z
CLI Version: 0.29.0 [76251df9]

Note that the fix in the commit here:

cc57dec

Has this big warning at the top, "This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository." Does that mean the fix was not included?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants