Skip to content
Snippets Groups Projects
Commit 02e7d79edf62 authored by Arseniy Alekseyev's avatar Arseniy Alekseyev
Browse files

branchmap: use mmap for faster revbranchcache loading

A typical revbranchmap usage is:
- load the entire revbranchmap file into memory
- maybe do a few lookups
- add a few bytes to it
- write the addition to disk

There's no reason to load the entire revbranchmap into memory.
We can split it into a large immutable prefix and a mutable suffix,
and then memorymap the prefix, thus saving all the useless loading.

Benchmarking on some real-world pushes suggests that out of ~100s server-side
push handling revbranchcache handling is responsible for:

* ~7s with no change
* ~1.3s with the change, without mmap
* 0.04s with the change, with mmap
parent 54a75576287a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment