( )⚙ D8092 hghave: cache the result of gethgversion

This is an archive of the discontinued Mercurial Phabricator instance.

hghave: cache the result of gethgversion
ClosedPublic

Authored by jcristau on Feb 7 2020, 10:02 AM.

Details

Summary

hghave --test-features calls it 90 times, each one calling hg --version
which takes a tenth of a second on my workstation, adding up to about
10s win on test-hghave.t.

Fixes https://bugs.debian.org/939756

Diff Detail

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

Event Timeline

jcristau created this revision.Feb 7 2020, 10:02 AM

I can confirm the perf win:

before: 10.687 seconds
after 3.6.19 seconds

marmoute accepted this revision.Feb 7 2020, 1:52 PM
pulkit added a subscriber: pulkit.Feb 7 2020, 3:21 PM

This is fixing some debian packaging issue, so is it targeted for stable branch?

It fixes a longstanding issue in tests, it's not particularly urgent IMO.

pulkit accepted this revision.Feb 7 2020, 4:02 PM
This revision is now accepted and ready to land.Feb 7 2020, 4:02 PM
This revision was automatically updated to reflect the committed changes.