Skip to content

Commit

Permalink
Restore the manifest size doubling when incrementally regenerating one
Browse files Browse the repository at this point in the history
It turns out this has a huge performance impact.
  • Loading branch information
glandium committed Nov 21, 2023
1 parent 59a5482 commit ec0337c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,8 @@ impl RawHgManifest {
cache.set(Some(last_manifest));
return RawHgManifest(reference_manifest);
}
manifest.reserve(reference_manifest.len());
// Generously reserve memory for the new manifest to avoid reallocs.
manifest.reserve(reference_manifest.len() * 2);
// TODO: ideally, we'd be able to use merge_join_by_path, but WithPath
// using an owned string has a huge impact on performance.
for entry in itertools::merge_join_by(
Expand Down

0 comments on commit ec0337c

Please sign in to comment.