This is an archive of the discontinued Mercurial Phabricator instance.

hg-core: make `Index` owner of its bytes (D8958#inline-14994 followup 1/2)
ClosedPublic

Authored by acezar on Sep 28 2020, 9:49 AM.

Details

Summary

Prevent building Index every time it is needed. It was a bad idea anyway.

When Index::new will return Result it will avoid things like Revlog::len
returning Result<usize> instead of usize.

  • make Index owner of its bytes
  • make Index::new return an error if offset != bytes.len()

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

acezar created this revision.Sep 28 2020, 9:49 AM
Alphare accepted this revision.Sep 28 2020, 10:28 AM
Alphare added a subscriber: Alphare.

Yep, this is a lot better. Does this affect the benchmarks at all?

acezar updated this revision to Diff 22910.Sep 29 2020, 4:20 AM

Yep, this is a lot better. Does this affect the benchmarks at all?

The whole series improves rhg cat by 2ms

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.