Re: A few micro-benchmarks for Jython 2 and two other ideas

Albert Cardona <[email protected]> Wed, 6 Jan 2021 00:36:55 +0000
Newsgroups gmane.comp.lang.jython.devel
Message-ID <CAJj13_92ej2v_VPtngj3Xnvq9i1+k5PGWX1+NFZfkeOceAm1Yg@mail.gmail.com>
Thanks Jeff, that was an enjoyable read. Thanks for putting this
together and sharing it!

Missatge de Jeff Allen <[email protected]> del dia dt., 5 de gen.
2021 a les 23:56:
>
> I've been thinking about the implementation of a Jython core that would
> make proper use of dynamic language features in Java.
>
> Although peformance is secondary to correctness, one would like to avoid
> producing elegantly correct code that could only ever run like a slug.
> Numerical operations are indispensible, so I constructed JMH benchmarks
> for dispatch of unary and binary operations on int and float, when these
> are "hot code". The short version of the results is:
>
> 1. A core may be implemented (called here VSJ 2) that broadly follows
> CPython, but uses a Java method handle in place of each C pointer to
> function, and it will run at an acceptable speed. (Comparison is
> difficult between JMH and timeit, but it is fair to say VSJ 2 has "about
> the speed of CPython".)
>
> 2. Jython 2 is a lot faster than VSJ 2, almost certainly because HotSpot
> in-lines and specialises virtual calls so effectively.
>
> 3. We may use the method handles from VSJ 2 in invokedynamic call sites.
> The result is a little faster than Jython 2 in places, and significantly
> slower in others. However, there is scope for further optimisation.
>
> A longer version is here:
> https://the-very-slow-jython-project.readthedocs.io/en/latest/performance/_performance.html
>
> Jeff
>
> --
> Jeff Allen
>
>
>
> _______________________________________________
> Jython-dev mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jython-dev