Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FileSystem: optimize lookup for last DirEnt
We do directory lookups in context of iterating over tarballs, which are usually sorted. We store our DirEnts sorted too. It's therefore very likely that if we're inserting an item, it'll be at the end of the array, and if we're looking for a directory to perform operations inside of, it's probably going to be the last DirEnt. That means that instead of starting our binary search on the middle element, we want to start with the last one. This is something like a ~10% improvement on the time it takes to compose the merged filesystem tree — in-memory — and brings the 'create a dumpfile for a ~250k files multi-layer container image' usecase from consistently slightly more than 0.5s to consistently slightly less than 0.5s.
- Loading branch information