Repository navigation
Open
Labels
P3Backlog: valid, low payoff-per-effortarea:storageStorage backends, nameservice, ledger lifecycle, index storage, cachesperformancePerformance improvement (release notes: Performance)
Description
annotation_hydration/scan is still 11–18% slower than #2018's merge base after #2018 lands. The PR's other memory-backed benches returned to the merge base or better.
Measurement
One round on an m7a.4xlarge, FLUREE_BENCH_PROFILE=full (100 samples), FLUREE_BENCH_SCALE=small. Each variant was built in its own tree with its own target directory, and each bench binary hashes differently across the three. The figures are criterion medians.
| bench | base ac26b463e |
fixes 1–3 70ad15aee |
#2018 head 0b8ae3e60 |
|---|---|---|---|
annotation_hydration/scan/100 |
1.52 ms | 2.08 ms (1.37×) | 1.69 ms (1.11×) |
annotation_hydration/scan/10000 |
173 ms | 300 ms (1.73×) | 205 ms (1.18×) |
annotation_hydration/arena/10000 |
129 ms | 160 ms (1.23×) | 139 ms (1.07×) |
annotation_hydration/scan/1 |
241 µs | 196 µs (0.81×) | 173 µs (0.72×) |
To reproduce, in each variant's tree, with a fresh TMPDIR per run:
FLUREE_BENCH_PROFILE=full FLUREE_BENCH_SCALE=small \
cargo bench -p fluree-db-api --bench annotation_hydration -- --noplot
The run was stopped after round 1 of two, so this is one sample per variant and may still be noise.
What is known
- The bench calls
fluree.ledger(), the uncached load, on every iteration (fluree-db-api/benches/annotation_hydration.rs). Each iteration therefore rebuilds the binary store: the root, the branch manifests and two small dictionaries, 8 store reads in all. It measures that rebuild as much as the scan. - Those reads go through
disk_cache::fetch_through_cache. On memory storage it now copies out of the store, where the base read the same bytes back from disk-cache files. fix: index storage growth — stats sketch GC, disk cache for local storage, drop of blob/ #2018 left that path alone, since itsVec<u8>return copies either way. - The annotation arena reader (
annotation_arena/reader.rs) fetches withstore.getand caches decoded leaves per reader. That path is the same in base and at the fix: index storage growth — stats sketch GC, disk cache for local storage, drop of blob/ #2018 head. - Leaf, dictionary-leaf and pack reads over memory storage no longer touch the store at the fix: index storage growth — stats sketch GC, disk cache for local storage, drop of blob/ #2018 head.
it_memory_storage_readspins this on a ledger loaded once.
To find it
- Re-run the
annotation_hydrationbench alone, two or more interleaved rounds, base against the fix: index storage growth — stats sketch GC, disk cache for local storage, drop of blob/ #2018 head, to confirm the gap is real. - Profile one
scan/10000iteration on each variant and compare where store loading spends its time. - Check whether the gap persists when the bench loads the ledger once, outside the timed loop. If it disappears, the cost is in the uncached load path, not in the scan.
Related: #2029 replaces fetch_through_cache and the read hooks around the trait; re-measure after its stage 2.
Metadata
Metadata
Assignees
Labels
P3Backlog: valid, low payoff-per-effortarea:storageStorage backends, nameservice, ledger lifecycle, index storage, cachesperformancePerformance improvement (release notes: Performance)
Activity