[r-t] Programming languages and environments for ringing software (was Writing method display software)
dfm at ringing.org
Tue Dec 1 01:02:05 UTC 2015
On 29 November 2015 at 13:18, Alan Burlison <alan.burlison at gmail.com> wrote:
> PyPy and Jython both attempt to be fully compliant Python
> implementations with run with their own JIT compilation on the the
> JVM (respectively), therefore hopefully avoiding some of the runtime
> bytecode interpretation performance issues of vanilla Python.
Be careful before committing to PyPy; it is no magic bullet. The JIT is, I
think, not as sophisticated as those in the best JVMs. Sufficiently
straightforward code it makes some substantial improvements to, constructs
the developers didn't consider, it doesn't. More importantly, though, PyPy
is more than just a JIT, it also has its own runtime, and many functions in
this runtime are slower than CPython's. Thus, code that spends most of its
time in long running runtime routines can actually be significantly SLOWER
in PyPy than in CPython. I have been unpleasantly surprised by this myself
with some cognitive modeling code (for Real World work, not ringing).
Also, PyPy lags significantly behind the latest CPython releases.
That said, I would guess that for most ringing purposes for which
performance is even an issue (remember that it often, possibly usually,
isn't), PyPy will probably be a win: I would expect those to be mostly (a)
dealing with permutations as byte arrays, which I'd guess (I've not
checked) PyPy likely does better with than CPython; and (b) dealing with
chasing references or dereferencing elements of tables while doing inner
loops in search algorithms, which I'd also guess (again not having checked)
PyPy likely wins at. However, I would strongly suggest trying it in both
PyPy and CPython and comparing; as cited above, I have been disappointed in
the past in a different problem domain.
Also, with PyPy3 being so far behind CPython evolution, it will probably be
less frustrating to use PyPy if you're sticking with Python 2.7.
Don Morrison <dfm at ringing.org>
"Premature optimization is the root of all evil."
-- Donald Knuth, "Structured Programming with Go To Statements"
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ringing-theory