# HG changeset patch # User Kyle Lippincott # Date 2021-04-16 23:21:26 # Node ID 8138092f8790b7efbcce66fa9c224ae87ff888de # Parent a2bf93ab3014d24bc49735295f02cff282b0a253 chg: pass --no-profile to disable profiling when starting hg serve If profiling is enabled via global/user config (as far as I can tell, this doesn't affect use of the --profile flag, but it probably does affect --config profiling.enabled=1), then the profiling data can be *cumulative* for the lifetime of the chg process. This leads to some "interesting" results where hg claims the walltime is something like 200s on a command that took only a second or two to run. Worse, however, is that with at least some profilers (such as the default "stat" profiler), this can cause a large slowdown while generating the profiler output. Differential Revision: https://phab.mercurial-scm.org/D10470 diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c --- a/contrib/chg/chg.c +++ b/contrib/chg/chg.c @@ -242,6 +242,7 @@ static void execcmdserver(const struct c const char *baseargv[] = { hgcmd, "serve", + "--no-profile", "--cmdserver", "chgunix", "--address", diff --git a/tests/test-chg.t b/tests/test-chg.t --- a/tests/test-chg.t +++ b/tests/test-chg.t @@ -529,7 +529,7 @@ FIXME: Run 4 should not be >3x Run 1's n > EOF Run 1: * samples (glob) Run 4: * samples (glob) - Run 4 > 3 * Run 1: True + Run 4 > 3 * Run 1: False (Disabling with --no-profile on the commandline still works, but isn't permanent) $ newchg log -r . --no-profile $ filteredchg log -r .