Re: Language execution speeds or "The Fibonacci Stats"


On Tue, Feb 14, 2017 at 08:37:22PM +0100, Tim Janik wrote:
On 14.02.2017 12:59, Stefan Westerfeld wrote:
While you're at it, there are two more JITs you could benchbark:
 - PyPy for Python
 - LuaJIT for Lua

Sure, barking at the bench, just like you request ;-)

The new results have Lua and Python catch up with Javascript pretty closely, so
giving these JITs a try was totoally worth it!

// user       0m0.328s        (gcc -O6)
// user       0m0.636s        (Java SE 8)
// user       0m0.716s        (clang -O3)
// user       0m0.720s        (rustc 1.7.0)
// user       0m0.884s        (D - gdc-5.4.0)
// user       0m1.596s        (js - node v4.2.6, v8
-- user       0m1.924s        (LuaJIT 2.0.4)
#  user       0m2.888s        (PyPy 5.1.2 / GCC 5.3.1)
#  user       0m10.168s       (jruby)
// user       0m14.904s       (php7)
#  user       0m17.556s       (ruby 2.3.1p112)
-- user       0m22.480s       (Lua 5.2.4)
// user       0m24.964s       (Java SE 8, interpreted mode execution only)
// user       0m26.152s       (pike)
#  user       0m27.292s       (Jython 2.5.3)
#  user       0m38.288s       (Python 2.7.12)
#  user       0m41.260s       (Python 3.5.2)
#  user       0m57.584s       (awk)
;; user       1m4.724s        (guile)
#  user       1m39.080s       (perl5)
#  user       9m5.000s        (perl6 - Rakudo 2016.06)

In this example, everything looks good with PyPy. However, there is one problem
why we currently can't use PyPy for the UI. I'd recommend using PyQt for the
Python UI. So we can

 * use Python as language for most UI code
 * implement only performance critical widgets directly in C++
 * use Qt standard widgets (buttons, checkboxes, filedialog, toolbars, menus...)
   where we need them

PyQt is a mature python extension for UI development. However, PyPy is in some
cases incompatible with C extensions designed for CPython, so unfortunately,
the PyQt extension doesn't work with PyPy. So this means that if we want
PyQt/Python for the UI development, we will have to use CPython. Still I
believe that since we have the option of implementing widgets in C++ when
performance is an issue, we should be able to use Python for most of the code,
and C++ where necessary (for instance: fancy realtime spectrum visualization).

As for PyPy support for PyQt, there is a mention on this page:

"We continue to make incremental improvements to our C-API compatibility layer
(cpyext). We pass all but 12 of the over-6000 tests in the upstream NumPy test
suite, and have begun examining what it would take to support Pandas and PyQt."

So there may be hope that some day PyPy and PyQt could be used together. But
right now it is not supported.

   Cu... Stefan
Stefan Westerfeld,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]