Replace fast lookup flat files with an incrementally-maintained sqlite database - #539
Open
citrus-it wants to merge 1 commit into
Open
Replace fast lookup flat files with an incrementally-maintained sqlite database#539citrus-it wants to merge 1 commit into
citrus-it wants to merge 1 commit into
Conversation
…e database
After every operation that changes the installed package set, the client
rebuilds its fast lookup cache from scratch, parsing the manifest of
every installed package. This is the "Creating fast lookup database"
phase, whose cost is proportional to the size of the image rather than
to the size of the change. The same full rebuild happens silently during
planning whenever the cache is found to be stale, and unprivileged
users, who cannot write to the image, rebuild the entire cache into a
temporary directory on every invocation.
This change replaces the flat files with a single sqlite database
managed by the new pkg.client.actioncache module. The database holds one
row for each installed action carrying the package, action name, key
attribute value and stripped action text. Rather than being rebuilt
fresh every time, the database is now incrementally maintained. The
post-operation phase now costs O(changed packages)) rather than O(all
installed manifests).
Measured on a clone of an OmniOS bloody boot environment, installing and
uninstalling a single small package (nano) (stock client vs this
change):
install (warm caches) 17.2s -> 6.6s
uninstall (warm caches) 16.1s -> 5.3s (user 13.5s -> 3.4s)
uninstall (cold caches) 27.6s -> 12.4s
planning only (install -nv) 4.15s -> 3.59s
full cache rebuild 9.7s -> 7.0s
oetiker
approved these changes
Aug 16, 2026
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.
Testsuite passes with this change