forked from containers/composefs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: Keep children sorted and lookup usign binary search
We're hitting this child lookup a lot when inserting file due to the check for existing files in add_child(), and then doubling this when cloning the tree in the writer. So, this makes lcfs_node_add_child() guarantee that children are sorted always, which means we can use a binary seach for all lookups, and we can avoid the qsort when canonicalizing images. This speeds up mkcomposefs on a large --from-file image from 790 msec to 470 msec. Signed-off-by: Alexander Larsson <[email protected]>
- Loading branch information
1 parent
29bf65c
commit d951b6e
Showing
1 changed file
with
60 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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