GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-45116: Add the Py_ALWAYS_INLINE macro by vstinner · Pull Request #28390 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Sep 16, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Add the Py_ALWAYS_INLINE macro to ask the compiler to always inline a
static inline function. The compiler can ignore it and decides to not
inline the function.

https://bugs.python.org/issue45116

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Sep 16, 2021
@bedevere-bot bedevere-bot added the awaiting core review label Sep 16, 2021
@vstinner

vstinner commented Sep 16, 2021

Copy link
Copy Markdown
Member Author

I decided to split my old PR #28141 in two parts:

  • (1) this PR adds the macro
  • (2) use the macro on some performance critical static inline functions
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 3 commits September 16, 2021 20:57
@vstinner
bpo-45116: Add the Py_ALWAYS_INLINE macro
dd42fc2
Add the Py_ALWAYS_INLINE macro to ask the compiler to always inline a
static inline function. The compiler can ignore it and decides to not
inline the function.
@vstinner
Rephrase the doc
fa020c8
@vstinner
Reformat the doc
73e5d10
@vstinner

vstinner commented Sep 16, 2021

Copy link
Copy Markdown
Member Author

PR rebased to retrieve the Windows build fix.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland approved these changes Sep 17, 2021
View reviewed changes

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

How about a What's New entry?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
vstinner merged commit 6b41355 into python:main Sep 17, 2021
@bedevere-bot bedevere-bot removed the awaiting core review label Sep 17, 2021
@vstinner
vstinner deleted the add_always_inline branch September 17, 2021 12:09
@vstinner

vstinner commented Sep 17, 2021

Copy link
Copy Markdown
Member Author

How about a What's New entry?

I don't want to advertise too much this macro :-D As I wrote in its documentation, misusing it can make the code slower.

Also, I'm not even sure if it should be used in Python :-) Benchmarks will give us some hints ;-)

erlend-aasland reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

niyas-sait pushed a commit to niyas-sait/cpython that referenced this pull request Sep 21, 2021
@vstinner @niyas-sait
bpo-45116: Add the Py_ALWAYS_INLINE macro (pythonGH-28390)
4fbde80
Add the Py_ALWAYS_INLINE macro to ask the compiler to always inline a
static inline function. The compiler can ignore it and decides to not
inline the function.
@neonene neonene mannequin mentioned this pull request Apr 10, 2022
Performance regression 3.10b1: inlining issue in the big _PyEval_EvalFrameDefault() function with Visual Studio (MSC) #89279
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland erlend-aasland approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@vstinner @erlend-aasland @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.