googlefonts / oxidize

Notes on moving tools and libraries to Rust.
Apache License 2.0
173 stars 7 forks source link

Does the pypy3 JIT compiler improve fontmake-based compile times? #28

Open chrissimpkins opened 2 years ago

chrissimpkins commented 2 years ago

PyPy is a Just-in-Time (JIT) Python compiler that can decrease execution times in some long running program scenarios (those that exceed the multiple second level warm up time required by the JIT compiler). It is highly compatible with Python code and has been used with the fontmake compiler Python pipeline sources.

pypy3 is the Python 3 support branch of pypy.

pypy features

Does it improve font compile times? If so, what type of font project benefits and are there downsides / workarounds required to use the approach?

chrissimpkins commented 2 years ago

cc @madig cc @justvanrossum

madig commented 2 years ago

Yes. A secret Google font project is compiled ~30% faster, but will also use ~5 GB more memory while doing it, than using CPython 3.8. Once table splitting is handled more gracefully, some of the speed gains might be reduced though.

chrissimpkins commented 2 years ago

Yes. A secret Google font project is compiled ~30% faster, but will also use ~5 GB more memory while doing it, than using CPython 3.8. Once table splitting is handled more gracefully, some of the speed gains might be reduced though.

What is the baseline cPy memory use here Nikolaus?

madig commented 2 years ago

Around 9 GB for CPython and 14 GB for Pypy.

rsheeter commented 2 years ago

Around 9 GB for CPython and 14 GB for Pypy.

GH runners might be stretched thin! https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources :D

madig commented 2 years ago

Oof. You know, I was thinking before that the pipeline could do with a deep dive with https://github.com/bloomberg/memray. One day maybe!