bpo-37774: use Py_LIKELY/Py_UNLIKELY for vectorcall #15144
bpo-37774: use Py_LIKELY/Py_UNLIKELY for vectorcall #15144jdemeyer wants to merge 3 commits intopython:mainfrom
Conversation
Include/pymacro.h
Outdated
There was a problem hiding this comment.
I think __GNUC__ > 2 is redundant.
There was a problem hiding this comment.
Redundant because Python won't compile with GCC 2.x anyway?
There was a problem hiding this comment.
Because:
- I don't know GCC 2.x supports all of C99 features we use in PEP 7.
- I don't know how to use GCC 2 to compile Python in recent days.
- I don't know who try to compile Python with GCC 2.
There was a problem hiding this comment.
I found this page: https://gcc.gnu.org/c99status.html
We use some GCC>=3.0 features already.
- designated initializers
- new block scopes for selection and iteration statements
- stdbool.h (GCC 2.95 had
<stdbool.h>, but based on an early draft with major differences from C99 semantics.)
|
I don't think these macros are useful for PGO build. In case of obmalloc.c, it only affects non-PGO build. |
140acb8 to
7881bc9
Compare
|
Rebased to latest master, fixed conflicts in @markshannon: what's your opinion on this? It achieves the same speedup as #14735 but in a more structural way. |
|
@markshannon do you have time for a review of this PR? Thank you |
|
This has three approvals - should it be merged once the conflicts are resolved? |
|
As @methane has said, given PGO does this for us, what's the point? Having said that. I'd be OK with https://github.com/python/cpython/pull/15144/files#diff-7f17c8d8448b7b6f90549035d2147a9fR4978 being added, as performance is deliberately being sacrificed when As for the others, probably not. |
markshannon
left a comment
There was a problem hiding this comment.
I see no benefit to this.
I'd rather leave this sort of tweaking to tools as they can adapt as the surrounding code changes.
|
@jdemeyer do you mind if I close this? |
|
This is rather out of date now, so I'm closing it. |
|
Closing as there are conflicts and the benefit is unclear. |
CC @markshannon @methane
https://bugs.python.org/issue37774