1. 28 May, 2020 13 commits
    • Kirill Smelkov's avatar
      X compilebench: Add type annotations to pystone_pyx.pyx · 74daf44d
      Kirill Smelkov authored
      This brings in ~8x speedup with tcc and ~14x speedup for gccO2 compared to what
      we already had for pystone.py already compiled by Cython.
      
      However Cython compilation time is 1.7x slower and compilation time for gcc*
      also raises significantly. For tcc it is "only" 30% more for compilation, but
      still the total tcc compilation time is very very small.
      
      name                    old time/op    new time/op    delta
      pycompile+pyimport        13.0ms ± 0%    13.0ms ± 0%       ~     (all equal)
      pyimport                  12.0ms ± 0%    12.0ms ± 0%       ~     (all equal)
      cython/py                  980ms ± 1%     982ms ± 1%       ~     (p=0.666 n=10+10)
      cython/pyx                 983ms ± 1%    1692ms ± 1%    +72.13%  (p=0.000 n=9+10)
      gcc/compile+link/py        603ms ± 0%     603ms ± 0%       ~     (p=0.766 n=8+10)
      gcc/compile+linkO2/py      2.15s ± 0%     2.15s ± 0%       ~     (p=0.749 n=10+10)
      gcc/compile+link/pyx       603ms ± 0%    1106ms ± 0%    +83.57%  (p=0.000 n=9+10)
      gcc/compile+linkO2/pyx     2.15s ± 0%     3.65s ± 0%    +69.87%  (p=0.000 n=10+10)
      tcc/compile+link/py       36.5ms ± 1%    36.0ms ± 0%     -1.37%  (p=0.022 n=10+9)
      tcc/compile+link/pyx      36.7ms ± 2%    47.5ms ± 3%    +29.43%  (p=0.000 n=10+10)
      
      name                    old pystone/s  new pystone/s  delta
      pystone/py                  227k ± 2%      228k ± 1%       ~     (p=0.182 n=10+9)
      pystone/py/gcc              220k ± 3%      221k ± 4%       ~     (p=0.796 n=10+10)
      pystone/py/gccO2            433k ± 2%      431k ± 5%       ~     (p=1.000 n=10+10)
      pystone/pyx/gcc             221k ± 1%     1855k ± 1%   +737.67%  (p=0.000 n=9+8)
      pystone/pyx/gccO2           435k ± 1%     6239k ± 2%  +1335.52%  (p=0.000 n=10+10)
      pystone/py/tcc              219k ± 2%      219k ± 0%       ~     (p=0.315 n=10+10)
      pystone/pyx/tcc             222k ± 2%     1826k ± 0%   +723.78%  (p=0.000 n=9+9)
      74daf44d
    • Kirill Smelkov's avatar
      X compilebench: Add pystone_pyx.pyx · aa25c782
      Kirill Smelkov authored
      This will be type-annotated version of pystone.py, but for now it is
      pristine copy, thus equal to it in all benchmarks.
      aa25c782
    • Kirill Smelkov's avatar
      X compilebench: Don't spend time measuring compile and link separately · 618c37fc
      Kirill Smelkov authored
      We know from past benchmarks that most of the time is in compile.
      618c37fc
    • Kirill Smelkov's avatar
      X compilebench: Rework how `tcc -O2` is skipped · 5346237c
      Kirill Smelkov authored
      Don't continue on `if $CC == tcc` -> instead put actions that are not
      appropriate for `tcc -O2` under `if $CC != tcc`. We will add other
      actions to that loop - that's the reason.
      
      In preparation to add pystone_pyx.pyx
      5346237c
    • Kirill Smelkov's avatar
      X compilebench: Also measure python compile/import and cython times · aae7ed82
      Kirill Smelkov authored
      Cython is currently slow:
      
      	name                time/op
      	pycompile+pyimport  13.0ms ± 0%
      	pyimport            12.0ms ± 0%
      	cython/py            983ms ± 1%
      aae7ed82
    • Kirill Smelkov's avatar
      X compilebench: Fix thinko: op/s -> s/op · ec14f9e5
      Kirill Smelkov authored
      We mesure time, not operations per second.
      ec14f9e5
    • Kirill Smelkov's avatar
      X compilebench: Rewok compile/link/compile+link to not hardcode on what to work · 26ad1917
      Kirill Smelkov authored
      In preparation to add pystone_pyx.pyx
      26ad1917
    • Kirill Smelkov's avatar
      X compilebench: pystone_pyxtest -> pystone_pypyx · 42dccdf8
      Kirill Smelkov authored
      In preparation that in addition to pystone.pt there will be also
      pystone_pyx.pyx with type annotations.
      42dccdf8
    • Kirill Smelkov's avatar
      X compilebech: pystone2bench: Accept scientific format · c840774c
      Kirill Smelkov authored
      pystone can say, e.g. "this machine benchmarks at 1.85343e+06 pystones"
      c840774c
    • Kirill Smelkov's avatar
      X compilebench: Don't spend time on clang · 77f99dbc
      Kirill Smelkov authored
      It is close to gcc.
      77f99dbc
    • Kirill Smelkov's avatar
      X -> py3 compatible print · e74624d0
      Kirill Smelkov authored
      e74624d0
    • Kirill Smelkov's avatar
      X Cythonize in py2 mode · 99c75057
      Kirill Smelkov authored
      Previously it was failing with master:
      
      (neo) (z-dev) (g.env) kirr@deco:~/src/tools/py/cython/t/compilebench$ ./doit.sh
      /home/kirr/src/tools/py/cython/Cython/Compiler/Main.py:344: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/kirr/src/tools/py/cython/t/compilebench/pystone_pyxtest.py
        tree = Parsing.p_module(s, pxd, full_module_name)
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      TRUE = 1
      FALSE = 0
      
      def main(loops=LOOPS):
          benchtime, stones = pystones(loops)
          print "Pystone(%s) time for %d passes = %g" % \
               ^
      ------------------------------------------------------------
      
      pystone_pyxtest.py:62:10: Syntax error in simple statement list
      99c75057
    • Kirill Smelkov's avatar
      Merge branch 'master' into x/compilebench · 1c5d9006
      Kirill Smelkov authored
      * master: (280 commits)
        Fix compilation in PyPy.
        Update changelog.
        Revert "Disable "c_api_binop_methods" directive in 0.29.x and provide it only as an enabled forward option."
        Disable "c_api_binop_methods" directive in 0.29.x and provide it only as an enabled forward option.
        Update changelog.
        Use Py_SET_SIZE() and Py_SET_REFCNT() on Python 3.9.0a4 and newer (GH-3639)
        Update changelog.
        Use Py_SET_SIZE() and Py_SET_REFCNT() on Python 3.9.0a4 and newer (GH-3639)
        Limited API updates and cleanup for #2056. GH-3635)
        Update changelog.
        Update changelog.
        Emit an error when typeid() is used outside of C++ mode (GH-3637)
        Fix overflow handling for abs() calls on signed integer types (GH-3634)
        Update changelog.
        Fix overflow handling for abs() calls on signed integer types (GH-3634)
        Fix handling of "no-cpp" test tag for error tests, where "cpp" is already removed from the list of test backends.
        Update changelog.
        Avoid "uninitialised" warnings for sizeof and typeid (GH-3631)
        Emit an error when typeid() is used outside of C++ mode (GH-3637)
        Fix handling of "no-cpp" test tag for error tests, where "cpp" is already removed from the list of test backends.
        ...
      1c5d9006
  2. 27 May, 2020 10 commits
  3. 26 May, 2020 16 commits
  4. 25 May, 2020 1 commit