Skip to content

Instantly share code, notes, and snippets.

@methane

methane/perf.md Secret

Created Feb 10, 2017
Embed
What would you like to do?

pyperformance

$ ../python.default -m perf compare_to default.json patched.json -G --min-speed=2
Slower (6):
- chameleon: 23.6 ms +- 0.3 ms -> 24.9 ms +- 0.4 ms: 1.06x slower (+6%)
- scimark_monte_carlo: 227 ms +- 4 ms -> 238 ms +- 6 ms: 1.05x slower (+5%)
- telco: 16.3 ms +- 0.4 ms -> 16.9 ms +- 0.4 ms: 1.03x slower (+3%)
- call_method_slots: 11.6 ms +- 0.2 ms -> 12.0 ms +- 0.1 ms: 1.03x slower (+3%)
- sympy_expand: 829 ms +- 10 ms -> 849 ms +- 8 ms: 1.02x slower (+2%)
- genshi_text: 75.0 ms +- 0.8 ms -> 76.5 ms +- 1.0 ms: 1.02x slower (+2%)

Faster (9):
- call_simple: 12.3 ms +- 0.5 ms -> 11.5 ms +- 0.4 ms: 1.06x faster (-6%)
- unpack_sequence: 121 ns +- 2 ns -> 115 ns +- 0 ns: 1.05x faster (-5%)
- spectral_norm: 246 ms +- 4 ms -> 235 ms +- 3 ms: 1.05x faster (-5%)
- logging_silent: 624 ns +- 10 ns -> 599 ns +- 7 ns: 1.04x faster (-4%)
- scimark_fft: 688 ms +- 15 ms -> 667 ms +- 16 ms: 1.03x faster (-3%)
- scimark_lu: 331 ms +- 13 ms -> 324 ms +- 10 ms: 1.02x faster (-2%)
- xml_etree_process: 186 ms +- 3 ms -> 182 ms +- 3 ms: 1.02x faster (-2%)
- scimark_sparse_mat_mult: 8.35 ms +- 0.23 ms -> 8.18 ms +- 0.27 ms: 1.02x faster (-2%)
- unpickle_list: 6.63 us +- 0.14 us -> 6.50 us +- 0.05 us: 1.02x faster (-2%)

chameleon

$ perf stat /home/inada-n/work/hg/cpython/bench/venv/cpython3.7-4c666deb0f00/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_chameleon.py
.....................
chameleon: Median +- std dev: 23.4 ms +- 0.3 ms

 Performance counter stats for '/home/inada-n/work/hg/cpython/bench/venv/cpython3.7-4c666deb0f00/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_chameleon.py':

      15284.006825      task-clock (msec)         #    0.702 CPUs utilized
               330      context-switches          #    0.022 K/sec
                96      cpu-migrations            #    0.006 K/sec
            222958      page-faults               #    0.015 M/sec
       67398605237      cycles                    #    4.410 GHz
       24845134550      stalled-cycles-frontend   #   36.86% frontend cycles idle
       15742758627      stalled-cycles-backend    #   23.36% backend cycles idle
      104292593477      instructions              #    1.55  insn per cycle
                                                  #    0.24  stalled cycles per insn
       21095641143      branches                  # 1380.243 M/sec
         466281977      branch-misses             #    2.21% of all branches

      21.777395740 seconds time elapsed

$ perf stat ./venv/cpython3.7- 4c666deb0f00/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_chameleon.py
cpython3.7-4c666deb0f00/ cpython3.7-b7097bf63c48/
inada-n@rinrin:~/work/hg/cpython/bench$ perf stat ./venv/cpython3.7-b7097bf63c48/bin/python ./venv/cpython3.7-b7097bf63c48/lib/python3.7/site-packages/performance/benchmarks/bm_chameleon.py
.....................
chameleon: Median +- std dev: 25.1 ms +- 0.4 ms

 Performance counter stats for './venv/cpython3.7-b7097bf63c48/bin/python ./venv/cpython3.7-b7097bf63c48/lib/python3.7/site-packages/performance/benchmarks/bm_chameleon.py':

      14444.526171      task-clock (msec)         #    0.630 CPUs utilized
               325      context-switches          #    0.022 K/sec
                94      cpu-migrations            #    0.007 K/sec
            222713      page-faults               #    0.015 M/sec
       70957487631      cycles                    #    4.912 GHz
       27446441807      stalled-cycles-frontend   #   38.68% frontend cycles idle
       18035616209      stalled-cycles-backend    #   25.42% backend cycles idle
      104170544069      instructions              #    1.47  insn per cycle
                                                  #    0.26  stalled cycles per insn
       21098930839      branches                  # 1460.687 M/sec
         505517292      branch-misses             #    2.40% of all branches

      22.926179783 seconds time elapsed

scimark.py monte_carlo

$ perf stat ./venv/cpython3.7-4c666deb0f00/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_scimark.py  monte_carlo
.....................
scimark_monte_carlo: Median +- std dev: 228 ms +- 7 ms

 Performance counter stats for './venv/cpython3.7-4c666deb0f00/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_scimark.py monte_carlo':

      18652.200745      task-clock (msec)         #    0.912 CPUs utilized
               323      context-switches          #    0.017 K/sec
               100      cpu-migrations            #    0.005 K/sec
            124385      page-faults               #    0.007 M/sec
       63259168060      cycles                    #    3.392 GHz
       16003935465      stalled-cycles-frontend   #   25.30% frontend cycles idle
        8594206664      stalled-cycles-backend    #   13.59% backend cycles idle
      124298662127      instructions              #    1.96  insn per cycle
                                                  #    0.13  stalled cycles per insn
       25097061846      branches                  # 1345.528 M/sec
         340596277      branch-misses             #    1.36% of all branches

      20.442680505 seconds time elapsed

$ perf stat ./venv/cpython3.7-b7097bf63c48/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_scimark.py  monte_carlo
.....................
scimark_monte_carlo: Median +- std dev: 236 ms +- 7 ms

 Performance counter stats for './venv/cpython3.7-b7097bf63c48/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_scimark.py monte_carlo':

      12626.002575      task-clock (msec)         #    0.594 CPUs utilized
               325      context-switches          #    0.026 K/sec
               101      cpu-migrations            #    0.008 K/sec
            125421      page-faults               #    0.010 M/sec
       65746030228      cycles                    #    5.207 GHz
       17752308937      stalled-cycles-frontend   #   27.00% frontend cycles idle
        9920226411      stalled-cycles-backend    #   15.09% backend cycles idle
      124607208736      instructions              #    1.90  insn per cycle
                                                  #    0.14  stalled cycles per insn
       25175437034      branches                  # 1993.936 M/sec
         373721687      branch-misses             #    1.48% of all branches

      21.246650886 seconds time elapsed

call_simple

$ perf stat ./venv/cpython3.7-4c666deb0f00/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_call_simple.py
.....................
call_simple: Median +- std dev: 11.6 ms +- 0.4 ms

 Performance counter stats for './venv/cpython3.7-4c666deb0f00/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_call_simple.py':

       7665.653102      task-clock (msec)         #    0.371 CPUs utilized
               325      context-switches          #    0.042 K/sec
                90      cpu-migrations            #    0.012 K/sec
            121825      page-faults               #    0.016 M/sec
       63921884100      cycles                    #    8.339 GHz
       12492231635      stalled-cycles-frontend   #   19.54% frontend cycles idle
        3324748753      stalled-cycles-backend    #    5.20% backend cycles idle
      167075935204      instructions              #    2.61  insn per cycle
                                                  #    0.07  stalled cycles per insn
       30192036579      branches                  # 3938.612 M/sec
          94952082      branch-misses             #    0.31% of all branches

      20.656700170 seconds time elapsed

$ perf stat ./venv/cpython3.7-b7097bf63c48/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_call_simple.py
.....................
call_simple: Median +- std dev: 10.9 ms +- 0.5 ms

 Performance counter stats for './venv/cpython3.7-b7097bf63c48/bin/python ./venv/cpython3.7-4c666deb0f00/lib/python3.7/site-packages/performance/benchmarks/bm_call_simple.py':

      12654.494284      task-clock (msec)         #    0.636 CPUs utilized
               331      context-switches          #    0.026 K/sec
               100      cpu-migrations            #    0.008 K/sec
            122075      page-faults               #    0.010 M/sec
       61613222500      cycles                    #    4.869 GHz
       13199953823      stalled-cycles-frontend   #   21.42% frontend cycles idle
        2931638963      stalled-cycles-backend    #    4.76% backend cycles idle
      162650472400      instructions              #    2.64  insn per cycle
                                                  #    0.08  stalled cycles per insn
       29357300298      branches                  # 2319.911 M/sec
          91281650      branch-misses             #    0.31% of all branches

      19.910164010 seconds time elapsed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment