Skip to content

Replace fast lookup flat files with an incrementally-maintained sqlite database - #539

Open
citrus-it wants to merge 1 commit into
omniosorg:masterfrom
citrus-it:perf
Open

Replace fast lookup flat files with an incrementally-maintained sqlite database#539
citrus-it wants to merge 1 commit into
omniosorg:masterfrom
citrus-it:perf

Conversation

@citrus-it

Copy link
Copy Markdown
Member

Testsuite passes with this change

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

2 participants