Page MenuHomePhabricator

hghave: cache the result of gethgversion
ClosedPublic

Authored by jcristau on Fri, Feb 7, 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

I can confirm the perf win:

before: 10.687 seconds
after 3.6.19 seconds

marmoute accepted this revision.Fri, Feb 7, 1:52 PM
pulkit added a subscriber: pulkit.Fri, Feb 7, 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.Fri, Feb 7, 4:02 PM
This revision is now accepted and ready to land.Fri, Feb 7, 4:02 PM
This revision was automatically updated to reflect the committed changes.