[Python-Dev] Possible performance regression
Le mer. 27 f?vr. 2019 ? 00:17, Victor Stinner <vstinner at redhat.com> a ?crit :
> My sad story with code placement:
> tl; dr Use PGO.
Hum wait, this article isn't complete. You have to see the follow-up:
Victor: "FYI I wrote an article about this issue:
it seems like I was just lucky when adding __attribute__((hot)) fixed
the issue, because call_method is slow again!"
I upgraded speed-python server (running benchmarks) to Ubuntu 16.04
LTS to support PGO compilation. I removed all old benchmark results
and ran again benchmarks with LTO+PGO. It seems like benchmark results
are much better now.
I'm not sure anymore that _Py_HOT_FUNCTION is really useful to get
stable benchmarks, but it may help code placement a little bit. I
don't think that it hurts, so I suggest to keep it. Since benchmarks
were still unstable with _Py_HOT_FUNCTION, I'm not interested to
continue to tag more functions with _Py_HOT_FUNCTION. I will now focus
on LTO+PGO for stable benchmarks, and ignore small performance
difference when PGO is not used.
I close this issue now.
Now I recall that I tried hard to avoid PGO: the server used by
speed.python.org to run benchmarks didn't support PGO.
I fixed the issue by upgrading Ubuntu :-) Now speed.python.org uses
PGO. I stopped to stop to manually help the compiler with code