Skip to content
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

Some small performance fixes #217

Merged
merged 2 commits into from
Oct 11, 2023
Merged

Conversation

alexlarsson
Copy link
Collaborator

Some things were weirdly slow that really shouldn't, primarily related to the hash use. Here are some small fixes.

Make check is really slow, and a lot of it is in
compute_erofs_shared_xattrs() when doing hash comparisons.

Various improvements are don:
 * Estimate of the initial hash-table size to avoid resizes
 * Compare the xattr values before the xattr key names (as the kay names are often the same).
 * Don't divide by n_buckets each characted in hash_memory.

This drops a mkcomposefs --from-file run from 5 seconds to 1 second.

Signed-off-by: Alexander Larsson <[email protected]>
Each time a child is added we grow by 1, which causes a lot of
reallocs when adding children. Growing capacity by doubling saves us
about 10% of the time of a mkcomposefs --from-image run.

Signed-off-by: Alexander Larsson <[email protected]>
@cgwalters cgwalters merged commit 35eb02e into containers:main Oct 11, 2023
8 checks passed
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