make-options-docs: don't sort the options XML file#142040
Merged
domenkozar merged 1 commit intoNixOS:masterfrom Oct 18, 2021
pennae:optimize-module-docs
Merged
make-options-docs: don't sort the options XML file#142040domenkozar merged 1 commit intoNixOS:masterfrom pennae:optimize-module-docs
domenkozar merged 1 commit intoNixOS:masterfrom
pennae:optimize-module-docs
Conversation
Member
|
Nice! How did you discover this? |
Contributor
Author
|
tried to figure out what the most expensive part of the module system is, ran a system instantiation with NIX_COUNT_CALLS=1, discovered that |
we need the file itself as a dependency for the docbook build, but we don't need it to be properly sorted at the nix level. push the sort out to a python script instead to save eval time. on the machine used to write this `nix-instantiate <nixos/nixos> -A system` went down from 7.1s to 5.4s and GC heap size decreased by 50MB (or 70MB max RSS).
Member
|
@LnL7 warned about this in a7d75ab#commitcomment-27486286 |
Member
|
Something like this is what I suggested back then 🙂 #33898 (comment) |
Member
|
We'll soon switch to markdown instead of xml files so we have to do something similar for But this keeps the current evaluation smaller so let's go! |
13 tasks
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.
Motivation for this change
eval times for nixos-rebuild are long and getting longer. turns out that about half of that time is spent just in make-option-docs, so optimizing that is quite worthwhile. just sorting the XML file with all option descriptions inside of the docbook build instead of in nix saves about 25% instantiation time.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)