This is an archive of the discontinued Mercurial Phabricator instance.

revlog: micro-optimize the computation of hashes
ClosedPublic

Authored by alex_gaynor on Jul 10 2017, 4:59 PM.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

alex_gaynor created this revision.Jul 10 2017, 4:59 PM
durin42 accepted this revision.Jul 11 2017, 11:21 AM

I'm grumpy at Python for making stupid things like this measurable. Queued.

This revision is now accepted and ready to land.Jul 11 2017, 11:21 AM
dsp added a subscriber: dsp.Jul 11 2017, 11:24 AM

LGTM.

Do we have any data if this speeds up hash computation? The patch seems small enough to justify either way.

I forget which workload it was (might have been hg up <bookmark>), I measured this stack as being a 7% improvement.

I've been trying to come up with a perf* command that shows off the win here, but at the end of the day it's producing fewer tuples, and that'll be a win.

Sigh.

Do you mean lists? The original version of this code doesn't allocate any tuples.

Yes, listen to what I mean, not what I say. ;)

quark retitled this revision from revlog: Micro-optimize the computation of hashes to revlog: micro-optimize the computation of hashes.Jul 11 2017, 12:14 PM
quark added a subscriber: quark.

I have un-capitalized the title so it looks more consistent with existing commits.

This revision was automatically updated to reflect the committed changes.