[PATCH 2 of 7] perf: perform a garbage collection before each iteration

Yuya Nishihara yuya at tcha.org
Tue Mar 14 04:26:01 EDT 2017


On Mon, 13 Mar 2017 22:15:44 -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1489454202 25200
> #      Mon Mar 13 18:16:42 2017 -0700
> # Node ID 3b997adb7efece7395fb585a70b2d70522626648
> # Parent  f6f1f5efe05f4e3737dc198284f548e31a616f4b
> perf: perform a garbage collection before each iteration
> 
> Currently, no explicit garbage collection is performed when running
> the microbenchmarks in `hg perf`. I think this is wrong because
> garbage collection can have a significant impact on execution times.
> And, if gc is triggered via the default heuristics, it will
> fire effectively randomly during subsequent benchmark iterations
> due to variable amount of garbage left over from previous runs.
> 
> Running a gc before invoking the measured function will help ensure
> state is more consistent across all iterations.

Makes sense. Queued the first two. I'll revisit the others later.


More information about the Mercurial-devel mailing list