perf: run the gc before each run
The python garbage collector is a large source of performance troubles, we run
it right before the timed section to reduce the change for the gc to add noise
to the benchmark.
# extension to emulate interrupting filemerge._filemerge
from mercurial import (
error,
extensions,
filemerge,
)
def failfilemerge(*args, **kwargs):
raise error.Abort(b"^C")
def extsetup(ui):
extensions.wrapfunction(filemerge, 'filemerge', failfilemerge)