[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2010-09-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: The whole approach doesn't seem to bear much fruit. I tried to apply again likely_decref.diff and got a 0% performance change on 3.2 (on a Core i3 processor). -- resolution: -> rejected status: open -> closed ___

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-26 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso added the comment: >Probably #if the definitions of Py_LIKELY and Py_UNLIKELY instead of __builtin_expect so new compilers can easily add their own definitions. This was done in the first version, but with the currently supported compilers it's simpler to do like

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-20 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Minor comments on likely_object.diff: * Py_LIKELY() and Py_UNLIKELY() would be better spellings than likely() and unlikely(). * The definitions should go in pyport.h instead of object.h * Usually don't put spaces after the "#". * Probably #if the definitions of

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-20 Thread Daniel Diniz
Changes by Daniel Diniz : Added file: http://bugs.python.org/file12817/ceval_function.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-20 Thread Daniel Diniz
Changes by Daniel Diniz : Added file: http://bugs.python.org/file12816/ceval_tuple_unpack.diff ___ Python tracker ___ ___ Python-bugs-list mail

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-20 Thread Daniel Diniz
Changes by Daniel Diniz : Added file: http://bugs.python.org/file12815/ceval_exception.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-20 Thread Daniel Diniz
Changes by Daniel Diniz : Added file: http://bugs.python.org/file12814/likely_object.diff ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-20 Thread Daniel Diniz
Daniel Diniz added the comment: New version of the patch, as well as one that doesn't touch Py_DECREF but defines likely and unlikely. Then, three ceval patches that result in small speedups (2% to 8% here), but don't play well together (neither with the Py_DECREF one). Since I get speedups for

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-20 Thread Daniel Diniz
Changes by Daniel Diniz : Removed file: http://bugs.python.org/file12731/likely_decref.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-16 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso added the comment: Yep, agreed. It could be quite cool to rely on __attribute__((cold)) to mark format_exc_check_arg(), but that only works with newer gcc's. I guess I'll add many likely() by hand - in some cases GCC might already get it right, but the heuristics u

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: You could also test this principle with a few opcodes in ceval.c. Especially, the error cases in LOAD_FAST, LOAD_GLOBAL etc. could be flagged as unlikely. ___ Python tracker ___

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-16 Thread Collin Winter
Changes by Collin Winter : -- nosy: +collinwinter, jyasskin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-14 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso added the comment: Also, GCC 2.95 does not support the construct, GCC 2.96 is required. So, I'd suggest defining likely/unlikely unconditionally and using this, which leads to less code overall: # if (__GNUC__ < 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) #

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-13 Thread Martin v. Löwis
Martin v. Löwis added the comment: I dislike about this patch that there are two different else cases (giving the trivial macro definition); there should only be one such case. -- nosy: +loewis ___ Python tracker _

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-13 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso added the comment: If speedup on other machines are confirmed, a slowdown of less than 2% should be acceptable (it's also similar to the statistic noise I have on my machine - it's a pity pybench does not calculate the standard deviation of the execution time). It

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: I get a slowdown here (results attached). Many objects are shortlived in Python, so I'm not sure the approach is valid anyway. Added file: http://bugs.python.org/file12732/pybench.txt ___ Python tracker

[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

2009-01-13 Thread Daniel Diniz
New submission from Daniel Diniz : As suggested by Paolo Giarrusso, add a "likely()" to Py_DECREF, telling GCC it doesn't call the destructor in the common path. This optimization seems to interact well with #4896 and to be slower on top of #4753 on my system. Patching ceval.c instead of object.