dispatch: start profiling earlier
This makes it possible to profile extension loading and setup, which
takes a substantial fraction of overall execution time for fast
commands.
(99% of this commit is simply changes of indentation to reflect the
hoisting of the two calls to maybeprofile to a single one that
happens earlier.)
# no-check-commit
ui: fix configwith doctest
4.2 cannot be expressed with IEEE floating point losslessly, and could
cause test failure on some platform:
File ".../mercurial/ui.py", line 414, in mercurial.ui.ui.configwith
Failed example:
u.configwith(float, s, 'float2')
Expected:
-4.2
Got:
-4.
2000000000000002
This patch fixes that by changing the number to 4.25, which can be expressed
by the binary number 100.01.
test-bdiff: move import inside the function to avoid test failure
test-check-module-imports.t fails on some systems where the path of home
directories is different than sys.prefix and sys.exec_prefix.
Importing silenttestrunner will help avoiding that failure.
profiling: add statprof support for Chrome trace viewer rendering
We synthesize function call begin/end events from snapshots, and
try (configurably) to eliminate "noisy" stack frames.
Example invocation:
hg --config profiling.output=$HOME/Desktop/clone.json \
--config profiling.statformat=chrome \
--profile clone https://www.mercurial-scm.org/repo/hg
ui: add a configwith method
This is a long-overdue generalization of the pattern in configint
and configbool.