perf: Improve startup workflow and code#852
Open
Maran23 wants to merge 1 commit into
Open
Conversation
Maran23
commented
Mar 26, 2026
| @@ -1,209 +1,207 @@ | |||
| /* | |||
Author
There was a problem hiding this comment.
This file was CRLF for me, changed it to LF.
You need to click Hide Whitespace here on Github to see the changes (only the Image).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the startup workflow and code. The goal is to have a more reliable, stable and faster startup.
This aims to fix:
What changed
SceneBuilderApphas now two public static methods:startInBackground(..), which takes an action and a task it should do after the action did run.This especially helpful to write code like:
startInBackground("Load Data", this::loadData, this::setData);Another advantage: The
SceneBuilderAppis the central point to coordinate such background tasks. So in the future, we can easily rely on that (e.g. to show aScrollBarwith all active backgrounds tasks)Startup code now uses this method to do everything that makes sense in the background, and everything UI related right after. This also avoids any sort of weird race conditions. The process what to do first, next and on the UI Thread is now very well defined.
I also found out that Scenebuilder sometimes processes an empty path for CSS in
PreferencesRecordDocument.In
SCENE_STYLE_SHEETS, an empty string might be written, which is then read out. This results in""to be treated as stylesheet, which will then be converted to your workspace/installation path. The CSS Parser later on then reads all files that are in the root of the Scenebuilder, so for example.editorconfig. This leads to a slower startup and CSS errors in the console.Very minor: The two Scenebuilder images are now created just once in
AppSettings. In my profiling, loading this images always for a new window made 2%, which is low, but still nice to save.Progress