googlefonts / oxidize

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

Do cPy 3.11.x interpreter startup and runtime performance improvements impact fontmake-based font compile times? #26

Open chrissimpkins opened 2 years ago

chrissimpkins commented 2 years ago

cPython 3.11 betas are documented to be ~25% faster than cPy 3.10 with improvements in interpreter startup and run times.

Do the cPy 3.11 changes improve font compile times with the fontmake-based Python compiler pipeline?

madig commented 2 years ago

"Failed to build compreffor pyclipper"

Seems like Cython has problems with 3.11. Not sure how easily this is fixed.

anthrotype commented 2 years ago

what's the error? maybe file a bug

madig commented 2 years ago

It's this one: https://github.com/aio-libs/aiohttp/issues/6600

Haven't looked into if this could be fixed by a version bump somewhere.

anthrotype commented 2 years ago

compreffor issue with cpython 3.11 should now be fixed with https://pypi.org/project/compreffor/0.5.2 please try again

anthrotype commented 2 years ago

also fixed the same issue in pyclipper https://pypi.org/project/pyclipper/1.3.0.post3/

madig commented 2 years ago

Installs now, kthx.

madig commented 2 years ago

Results for the cut-instances branch, which excludes Telugu:

Benchmark 1: make -j (CPython 3.8.10)
  Time (mean ± σ):     483.297 s ±  0.042 s    [User: 3020.954 s, System: 18.076 s]
  Range (min … max):   483.267 s … 483.327 s    2 runs

Benchmark 1: cd ../googlesans-cp311 ; make -j (CPython 3.11b3)
  Time (mean ± σ):     404.991 s ±  1.003 s    [User: 2513.287 s, System: 12.531 s]
  Range (min … max):   404.281 s … 405.700 s    2 runs

Benchmark 1: cd ../googlesans-pypy ; make -j (Pypy 7.3.9)
  Time (mean ± σ):     345.172 s ±  1.359 s    [User: 1673.498 s, System: 17.142 s]
  Range (min … max):   344.211 s … 346.133 s    2 runs

So, 3.11b3 is 16% faster than 3.8 and Pypy is 29% faster than 3.8. Note: I upgarded all deps to their newest version for 3.11 but saw no obvious unfairness.

behdad commented 2 years ago

Beauty.

behdad commented 2 years ago

Maybe report back upstream. 👏

chrissimpkins commented 2 years ago

@madig The results in https://github.com/googlefonts/oxidize/issues/26#issuecomment-1154412465 are from GS compiles?

chrissimpkins commented 2 years ago

How is memory use in the cPy 3.11 vs. cPy < 3.11 comparison? Any significant changes there?

Related mem issues with pypy3 compile time performance improvements documented in #28

madig commented 2 years ago

@madig The results in #26 (comment) are from GS compiles?

Yes, from before Telugu landed.

I have not measured memory usage.