Development environment

NOTE:For system specs see here

Setting up the dev-environment

Requirements:

  • perf-module
    •     python3 -m pip install perf
          python2 -m pip install perf
      
  • performance
    •     python3 -m pip install performance
          python2 -m pip install performance
      
  • cProfile
  • Kcachcegrind
  • pyprofcalltree(For py2 Install tar and then after untarring do python2 setup.py install)

To generate comaparison of benchmarks:

Now run the following:

  sudo python3 -m perf system tune
  sudo python2 -m perf system tune
  pyperformance run --python=python2 -o py2.json
  pyperformance run --python=python3 -o py3.json
  pyperformance compare py2.json py3.json
  python3 -m perf compare_to py2.json py3.json --table        

It generates the following table(data obviously won’t match exactly):

  | Benchmark               | py2      | py3                           |
  +=========================+==========+===============================+
  | 2to3                    | 1.70 sec | 1.36 sec: 1.25x faster (-20%) |
  +-------------------------+----------+-------------------------------+
  | call_method_slots       | 18.5 ms  | 21.7 ms: 1.17x slower (+17%)  |
  +-------------------------+----------+-------------------------------+
  | chameleon               | 35.3 ms  | 30.0 ms: 1.18x faster (-15%)  |
  +-------------------------+----------+-------------------------------+
  | crypto_pyaes            | 249 ms   | 311 ms: 1.25x slower (+25%)   |
  +-------------------------+----------+-------------------------------+
  | deltablue               | 27.7 ms  | 23.1 ms: 1.20x faster (-16%)  |
  +-------------------------+----------+-------------------------------+
  | fannkuch                | 968 ms   | 1.30 sec: 1.35x slower (+35%) |
  +-------------------------+----------+-------------------------------+
  | float                   | 493 ms   | 431 ms: 1.14x faster (-13%)   |
  +-------------------------+----------+-------------------------------+
  | go                      | 683 ms   | 802 ms: 1.18x slower (+18%)   |
  +-------------------------+----------+-------------------------------+
  | hexiom                  | 26.0 ms  | 32.6 ms: 1.25x slower (+25%)  |
  +-------------------------+----------+-------------------------------+
  | html5lib                | 664 ms   | 424 ms: 1.57x faster (-36%)   |
  +-------------------------+----------+-------------------------------+
  | json_dumps              | 34.3 ms  | 41.7 ms: 1.22x slower (+22%)  |
  +-------------------------+----------+-------------------------------+
  | json_loads              | 146 us   | 76.8 us: 1.90x faster (-47%)  |
  +-------------------------+----------+-------------------------------+
  | logging_format          | 57.7 us  | 75.1 us: 1.30x slower (+30%)  |
  +-------------------------+----------+-------------------------------+
  | logging_silent          | 818 ns   | 1.00 us: 1.22x slower (+22%)  |
  +-------------------------+----------+-------------------------------+
  | logging_simple          | 46.2 us  | 70.0 us: 1.51x slower (+51%)  |
  +-------------------------+----------+-------------------------------+
  | mako                    | 89.4 ms  | 62.2 ms: 1.44x faster (-30%)  |
  +-------------------------+----------+-------------------------------+
  | meteor_contest          | 262 ms   | 308 ms: 1.18x slower (+18%)   |
  +-------------------------+----------+-------------------------------+
  | pickle                  | 47.1 us  | 26.0 us: 1.81x faster (-45%)  |
  +-------------------------+----------+-------------------------------+
  | pickle_dict             | 82.5 us  | 70.4 us: 1.17x faster (-15%)  |
  +-------------------------+----------+-------------------------------+
  | pickle_list             | 15.1 us  | 8.86 us: 1.71x faster (-41%)  |
  +-------------------------+----------+-------------------------------+
  | pickle_pure_python      | 1.16 ms  | 1.54 ms: 1.33x slower (+33%)  |
  +-------------------------+----------+-------------------------------+
  | pidigits                | 323 ms   | 358 ms: 1.11x slower (+11%)   |
  +-------------------------+----------+-------------------------------+
  | python_startup          | 19.2 ms  | 42.3 ms: 2.21x slower (+121%) |
  +-------------------------+----------+-------------------------------+
  | python_startup_no_site  | 9.42 ms  | 26.0 ms: 2.76x slower (+176%) |
  +-------------------------+----------+-------------------------------+
  | raytrace                | 1.49 sec | 1.86 sec: 1.25x slower (+25%) |
  +-------------------------+----------+-------------------------------+
  | regex_compile           | 561 ms   | 717 ms: 1.28x slower (+28%)   |
  +-------------------------+----------+-------------------------------+
  | regex_dna               | 311 ms   | 382 ms: 1.23x slower (+23%)   |
  +-------------------------+----------+-------------------------------+
  | regex_effbot            | 6.20 ms  | 7.04 ms: 1.14x slower (+14%)  |
  +-------------------------+----------+-------------------------------+
  | regex_v8                | 76.6 ms  | 59.2 ms: 1.29x faster (-23%)  |
  +-------------------------+----------+-------------------------------+
  | richards                | 201 ms   | 234 ms: 1.16x slower (+16%)   |
  +-------------------------+----------+-------------------------------+
  | scimark_fft             | 736 ms   | 873 ms: 1.19x slower (+19%)   |
  +-------------------------+----------+-------------------------------+
  | scimark_lu              | 681 ms   | 652 ms: 1.04x faster (-4%)    |
  +-------------------------+----------+-------------------------------+
  | scimark_monte_carlo     | 267 ms   | 322 ms: 1.21x slower (+21%)   |
  +-------------------------+----------+-------------------------------+
  | scimark_sor             | 530 ms   | 672 ms: 1.27x slower (+27%)   |
  +-------------------------+----------+-------------------------------+
  | scimark_sparse_mat_mult | 8.93 ms  | 10.9 ms: 1.22x slower (+22%)  |
  +-------------------------+----------+-------------------------------+
  | spectral_norm           | 252 ms   | 354 ms: 1.40x slower (+40%)   |
  +-------------------------+----------+-------------------------------+
  | sqlite_synth            | 6.70 us  | 7.95 us: 1.19x slower (+19%)  |
  +-------------------------+----------+-------------------------------+
  | sympy_expand            | 2.56 sec | 1.63 sec: 1.56x faster (-36%) |
  +-------------------------+----------+-------------------------------+
  | sympy_sum               | 635 ms   | 569 ms: 1.12x faster (-10%)   |
  +-------------------------+----------+-------------------------------+
  | sympy_str               | 1.18 sec | 776 ms: 1.52x faster (-34%)   |
  +-------------------------+----------+-------------------------------+
  | telco                   | 1.37 sec | 17.4 ms: 78.40x faster (-99%) |
  +-------------------------+----------+-------------------------------+
  | tornado_http            | 1.60 sec | 894 ms: 1.79x faster (-44%)   |
  +-------------------------+----------+-------------------------------+
  | unpickle                | 47.7 us  | 37.8 us: 1.26x faster (-21%)  |
  +-------------------------+----------+-------------------------------+
  | xml_etree_parse         | 296 ms   | 488 ms: 1.65x slower (+65%)   |
  +-------------------------+----------+-------------------------------+
  | xml_etree_generate      | 724 ms   | 340 ms: 2.13x faster (-53%)   |
  +-------------------------+----------+-------------------------------+
  | xml_etree_process       | 641 ms   | 301 ms: 2.13x faster (-53%)   |
  +-------------------------+----------+-------------------------------+    

Here’s a chart representing above data(less is better):

Written on May 19, 2017