Skip to content

Conversation

@jdemeyer
Copy link
Contributor

@jdemeyer jdemeyer commented Aug 6, 2019

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think __GNUC__ > 2 is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant because Python won't compile with GCC 2.x anyway?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Member

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not super fan of exposing these macros, by I agree with @methane in that they are battle tested. Do we have some benchmarks numbers for the effect of this (with PGO, as PGO also activates branch-prediction annotations)?

@methane
Copy link
Member

methane commented Aug 9, 2019

I don't think these macros are useful for PGO build. In case of obmalloc.c, it only affects non-PGO build.

@jdemeyer
Copy link
Contributor Author

Rebased to latest master, fixed conflicts in obmalloc.c

@markshannon: what's your opinion on this? It achieves the same speedup as #14735 but in a more structural way.

@matrixise
Copy link
Member

@markshannon do you have time for a review of this PR? Thank you

@csabella
Copy link
Contributor

This has three approvals - should it be merged once the conflicts are resolved?

@csabella csabella requested a review from markshannon June 12, 2020 12:15
@markshannon
Copy link
Member

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 sys.settrace is used.

As for the others, probably not.

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@markshannon
Copy link
Member

@jdemeyer do you mind if I close this?

@markshannon
Copy link
Member

This is rather out of date now, so I'm closing it.

@kumaraditya303
Copy link
Contributor

Closing as there are conflicts and the benefit is unclear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.