Repository navigation
Open in about a second: setup's state no longer waits on the inactive Wine app - #841
Merged
Merged
Conversation
The startup refreshes held setup's state until the other runtime's Wine app was refreshed too, a deep signature check of a 4.4 GB app at best. On the FEX build the x86_64 app's source is the installed app itself, so a damaged one was copied onto itself on every launch and failed, holding the UI for ~20 s. Setup's state now waits only for the active runtime, and an app is never reinstalled from itself.
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.
MetalSharp took about 21 s from launch to a loaded library on a FEX install with the x86_64 runtime installed too. Now it takes about 1.1 s (1.15, 1.16 and 1.08 s over three cold launches of the FEX build).
Why it was slow
The backend's startup refreshes run on threads of their own. While they run,
/setup/statewaits for them (ms_wine_refresh_wait). The backend answers one request at a time, so the window's first load waited too. The wait covered the inactive runtime's Wine app as well (ms_wine_refresh_inactive_app): at best acodesign --verify --deep --strictof a 4.4 GB app, plus achmod -R.On the FEX build, the x86_64 app's source (
app_source) is the installedruntime/MetalSharp-Wine-x86_64.appitself, since MetalSharp.app doesn't carry one. When that installed app fails its deep check,install_app_lockedcopied it onto itself (ditto, thencp -Rp) on every launch. The copy failed its check too, after about 20 s of holding the UI, andlogs/setup-metalsharp-wine.loggrew with "a sealed resource is missing or invalid" each time.Changes
refresh_thread(FEX) andx86_64_refresh_thread(regular) end the refresh gate once the active runtime is laid out. They refresh the other runtime's app after that, so setup's state no longer waits on it. That app only replaces the one kept aside and lays nothing out, so setup's state doesn't depend on it.install_app_lockedleaves an app alone when its source is the installed app itself. Nothing newer exists to install from, and a copy onto itself can't fix it.wine_runtime_test.cchecks that an installed app that is its own source installs without a staging copy. The test fails onmainand passes here.Testing
make -C app/src-c test, and the same withVARIANT=fex BUILD_DIR=…/build-fex: both pass.opento "Loaded Steam library".maintook about 21 s on the same machine. A sample of the app's main thread during startup shows it idle.Merging
#838 also opens an Unreleased section in CHANGELOG.md. Whichever merges second needs its entry moved under the other's heading.