Startup time is regressing

Matt Mackall mpm at selenic.com
Sun Nov 7 17:44:15 CST 2010


$ for x in 0 1 2 3 4 5 6 7; do echo -n 1.$x:; HGRCPATH= hg1$x --config
extensions.perf=/home/mpm/hg/contrib/perf.py perfstartup; done
1.0:! wall 0.048510 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
1.1:! wall 0.048628 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
1.2:! wall 0.049273 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
1.3:! wall 0.049570 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
1.4:! wall 0.050020 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
1.5:! wall 0.050725 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
1.6:! wall 0.060780 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
1.7:! wall 0.062400 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)

That's the time it takes to run 'hg version -q'. That's 28.7% slower,
mostly since 1.5. Most of the big hit in 1.6 appears to come from:

changeset:   11297:d320e70442a5
user:        FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
date:        Sun Jun 06 17:20:10 2010 +0900
summary:     replace Python standard textwrap by MBCS sensitive one for
i18n text

Ouch.


For reference, this is what we get with demand-importing off:

1.0:! wall 0.175151 comb 0.000000 user 0.000000 sys 0.000000 (best of 56)
1.7:! wall 0.201280 comb 0.000000 user 0.000000 sys 0.000000 (best of 49)

Some other numbers for comparison:

python 2.6.6 --version: 0.00501s
python 2.6.6 -c 'print "hello world"': 0.02431s

python 3.1.2 --version: 0.00536s
python 3.1.2 -c 'print("hello world")': 0.04105s

perl 5.10.1 -e 'print "hello world"': 0.00673s
perl 5.10.1: 0.00571s 

So a huge chunk of our time is taken just getting the Python interpreter
off the ground. And Python's rather slow at this (with Py3k being much
slower still).

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list