Skip to content

Conversation

@Stefterv
Copy link
Collaborator

Moved several initialization tasks to background threads for improved startup performance and responsiveness, including tool, font, UI, and suggestion generator setup. Deferred some tool initialization until first use, added caching for SVG rendering, and simplified string loading in PApplet. Also made minor changes to library list and variable inspector initialization.

  • Find a way to display the splash screen optionally as Preferences will not yet be initialised.
Screen.Recording.2025-10-22.at.17.12.21.mov

@Stefterv Stefterv requested a review from catilac October 22, 2025 15:15
@catilac
Copy link
Collaborator

catilac commented Oct 24, 2025

Cool! How much did performance improve? Also what is going on with the preferences not being initialized meaning adding a new settings thing.

Do any of these threads need to be joined at some point? Or it's fine for all of them to just start and end whenever?

@Stefterv
Copy link
Collaborator Author

Stefterv commented Oct 27, 2025

Performance went from 1500ms to 350ms startup time, so now the welcome & splash screen itself is actually the biggest bottleneck in starting.

The Preferences class is not necessarily initialised when starting the Welcome screen, we could either initialise it early (but I think that might cause other issues) or we could use Java's Preferences maybe instead.

As for joining the threads, I wanted to look into this further, so far in my testing the PDE starts just fine and I haven't noticed any issues, but that's only tested on one devices on one os, so not particularly extensive (:

Moved several initialization tasks to background threads for improved startup performance and responsiveness, including tool, font, UI, and suggestion generator setup. Deferred some tool initialization until first use, added caching for SVG rendering, and simplified string loading in PApplet. Also made minor changes to library list and variable inspector initialization.

# Conflicts:
#	app/src/processing/app/Base.java
#	app/src/processing/app/platform/DefaultPlatform.java
@Stefterv Stefterv marked this pull request as ready for review February 9, 2026 13:36
@tychedelia
Copy link
Member

Have you considered using an ExecutorService instead of manually creating all the threads? That could provide better control or allow thread reuse particularly for tasks that are small.

@Stefterv
Copy link
Collaborator Author

Stefterv commented Feb 9, 2026

No I didn't know of that! I think in general the startup sequence needs a revisit, so this PR is a stopgap to at least get some speedup without doing a larger refactor as I don't see that happening anytime soon

@catilac
Copy link
Collaborator

catilac commented Feb 10, 2026

If there is a thread pool manager we can use to manage threads we should use that. I'd prefer we not introduce the use of low-level concurrency primitives on the app startup code paths to improve startup performance when it sounds like it all needs to be changed anyways.

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

Successfully merging this pull request may close these issues.

3 participants