-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
write-qt-apps-hook.sh: use make-binary-wrapper for significant speedups #225881
Conversation
QT apps tend to call makeWrapper with a lot of arguments, which causes noticable slowdowns (+100ms for app startup). The slow down boils down to two reasons: - the required string processing is O(N^2) - bash is slow at doing the processing By using the binary wrapper, we fix the second point, brining the overhead down from 100ms to just 4ms or thereabouts. I tested this change by rebuilding my whole system with it (I use plasma). It booted and it works (that's where I type this commit message), but I am not 100% sure if this won't break anything else. Closes: NixOS#225871
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be none breaking if all arguments are supported. Probably needs to go to staging.
Can I change the base branch to EDIT: ah, that's explained in the manual, retargeted |
Should be fine, but I'd probably keep this for after 23.05 as it's the kind of change that has spooky implications. |
If all things build, this should just work but it could be that some things use flags not supported by the binary wrapper which would trigger a build failure. binary wrapper is already used by wrapGAppsHook and more things on darwin due to that the shebang must be a binary. |
I'm expecting it to be fine, but will it be "last staging cycle before release" fine? I'm less confident. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try, but we should revert in case of large issues.
Is there any plan to simplify the wrapper logic? Is it possible? It is not only slow but also as big as ~40KB for one bash wrapper ( |
Do you mean the binary or the shell wrapper? The binary wrapper should already be a lot more optimized. The shell wrapper could probably be greatly optimized if we didn't check for every entry if the first and final : are there but since we want to deduplicate the entries it will probably stay longish. Maybe we could try to reduce the amount of entries added or symlinkJoin beforehand. |
I think tdesktop is broken now?
|
I encountered the same
|
Never mind, tdesktop shoots itself in the foot: #228410 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/telegram-fails-to-run-sigsegv-address-boundary-error/27667/2 |
also kills gnuplot-qt:
|
Fix for |
A better fix is already in staging: #229154 |
Description of changes
QT apps tend to call makeWrapper with a lot of arguments, which causes noticable slowdowns (+100ms for app startup). The slow down boils down to two reasons:
By using the binary wrapper, we fix the second point, brining the overhead down from 100ms to just 4ms or thereabouts.
I tested this change by rebuilding my whole system with it (I use plasma). It booted and it works (that's where I type this commit message), but I am not 100% sure if this won't break anything else.
Closes: #225871
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)