[issue28618] Decorate hot functions using __attribute__((hot)) to optimize Python

STINNER Victor report at bugs.python.org
Tue Nov 15 09:21:57 EST 2016


STINNER Victor added the comment:

hot3.patch: Mark additional functions as hot

* PyNumber_AsSsize_t()
* _PyUnicode_FromUCS1()
* json: scanstring_unicode()
* siphash24()
* sre_ucs1_match, sre_ucs2_match, sre_ucs4_match

I'm not sure about this patch. It's hard to get reliable benchmark results on microbenchmarks :-/ It's hard to understand if a speedup comes from the hot attribute, or if the compiler decided itself to change the code placement. Without the hot attribute, the code placement seems random.

----------
Added file: http://bugs.python.org/file45488/hot3.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28618>
_______________________________________


More information about the Python-bugs-list mailing list