python / pyperformance

Python Performance Benchmark Suite
http://pyperformance.readthedocs.io/
MIT License
869 stars 175 forks source link

Allow pyperformance to compile CPython with the JIT enabled. #345

Closed diegorusso closed 2 months ago

diegorusso commented 5 months ago

From 3.13, CPython can be built with the JIT and it doesn't seem to be the way to pass custom flags to the configure or the compile step: https://github.com/python/pyperformance/blob/784d0421f387f6245ecbbe744a530c238c60c741/pyperformance/compile.py#L277

It would be nice to have either:

I don't have strong opinions for both implementations and TBH we could have both. The former is more generic and flexible, the latter more explicit.

brandtbucher commented 5 months ago

@mdboom, would this be helpful for us?

mdboom commented 5 months ago

I think it's a good idea in order to make it easier for others. The Faster CPython team's infrastructure doesn't actually use pyperformance compile, but in the interests of open source, it probably wouldn't be a bad idea to close the gap there so pyperformance compile is feature-complete and our infrastructure could start using it.

diegorusso commented 5 months ago

Thanks for confirming that. I guess the only way possible for now is to compile Python outside of pyperformance and then instruct pyperformance to run benchmarks with the just compiled CPython. I agree with @mdboom, I think it is useful if we can expose the JIT as configuration options. In the same line of the JIT we could expose the option for free threading as well (in a separate PR). For the sake of flexibility it would be nice to expose an interface to pass whatever flags we want to the ./configure (but this can come in a further PR).

diegorusso commented 3 months ago

PR: https://github.com/python/pyperformance/pull/351