Skip to content

perf: Improve startup workflow and code#852

Open
Maran23 wants to merge 1 commit into
gluonhq:masterfrom
Maran23:startup-workflow
Open

perf: Improve startup workflow and code#852
Maran23 wants to merge 1 commit into
gluonhq:masterfrom
Maran23:startup-workflow

Conversation

@Maran23

@Maran23 Maran23 commented Mar 26, 2026

Copy link
Copy Markdown

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

SceneBuilderApp has 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 SceneBuilderApp is the central point to coordinate such background tasks. So in the future, we can easily rely on that (e.g. to show a ScrollBar with 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

@@ -1,209 +1,207 @@
/*

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

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.

1 participant