LoginSignup
0
0

More than 1 year has passed since last update.

Dogelog Player: New PyPy offers significant Speed-Up

Last updated at Posted at 2023-01-20

Introduction

Dogelog player is a Prolog system written 100% in Prolog targetting the JavaScript and the Python platform. We have adopted the core benchmark suite from formerly Jekejeke Prolog and usually run it for both nodeJS and PyPy.

doge-car.jpg

The benchmark suite gives some proof that the new PyPy v7.3.10 offers a significant speed-up of ca. 25% over its previous versions. We report month-to-month benchmark results and some thoughts on the future of the Dogelog player.

PyPy v7.3.10 Release

PyPy is a Python interpreter that features a tracing JIT compiler and is an interesting alternative to CPython because of its speed. PyPy v7.3.9 was released on march 2022 and that was mainly the version we were ticking along when developing the Dogelog player.

In early december 2022 a new version PyPy v7.3.10 arrived. This version not only extends the reach of PyPy to the new Apple Silicon M1. It also came with a huge list of speed improvements. We don't know which changes do impact Dogelog Player most, but the impact is significant.

Such drastic changes pose a challenge to the Dogelog Player since it features a Prolog specific garbage collector. This garbage collector is configured so that it roughly triggers 60 times per second, making it aligning with animations of this frequency.

AMD Ryzen Results

One of our testing equipment is an AMD Ryzen CPU on Windows 10. We could measure a speed-up of ca. 28%. We conducted a little experiment with an adaptive auto tuning garbage collector, but we do not yet ship such a more advanced garbage collector. So the prospect 03.23 refers to our current manual tuning.

image.png

There is still a gap between nodeJS performance and PyPy performance, but this gap has now been narrowed. Whereas PyPy was like 3x times slower than nodeJS it seems to us that it is now only around 2x times slower than nodeJS. At least our core benchmark gives such a suggestion.

Intel gen11 Results

Another testing equipment is an Intel gen11 CPU on Windows 11. We could measure a speed-up of ca. 23%. We used the same manual constants as in the previous testing, not differentiating between the two different CPUs which run on different CPU speeds and have also varying speed factors.

image.png

Unfortunately our testing excludes the browser so far. For the browser an auto tuning garbage collector would be ideal, since it could account for the 4ms delay in setTimeout(). We are not yet there and had some defensive manual tuning in the past, and as an interim solution will try two manual tuning settings with a browser detection mechanism.

Conclusions

The new PyPy v7.3.10 is a motivation to keep the Python target platform for the Dogelog player. It seems that PyPy has once narrowed the gap to nodeJS. On the other hand the Dogelog player gets reminded to investigate new ideas such as an auto tuning garbage collector and hopefully a speed-up changelog as well.

PyPy v7.3.10 release
https://www.pypy.org/posts/2022/12/pypy-v7310-release.html

Dogelog Player
https://www.xlog.ch/izytab/doclet/en/docs/23_products/05_dogelog/package.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0