Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-98522: Add version number to code objects, to provide better version numbers for closures and comprehensions.#98525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
markshannon merged 6 commits intopython:mainfromfaster-cpython:code-version
Dec 9, 2022

Conversation

markshannon
Copy link
Member

@markshannonmarkshannon commentedOct 21, 2022
edited by bedevere-bot
Loading

Measured performance impactmight be positive but is too close to noise to be meaningful.

@markshannonmarkshannon changed the titleAdd version number to code objects, to provide better version numbers for closures and comprehensions.GH-98522: Add version number to code objects, to provide better version numbers for closures and comprehensions.Oct 21, 2022
@brandtbucherbrandtbucher self-requested a reviewNovember 18, 2022 21:02
@@ -472,6 +472,8 @@ typedef struct _PyShimCodeDef {
extern PyCodeObject *
_Py_MakeShimCode(const _PyShimCodeDef *code);

extern uint32_t _Py_next_func_version;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason why this is called func_version and not code_version? I find it a bit confusing (note that in deepfreeze.py we now have_Py_next_func_version = {next_code_version}).

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It is primarily used as the version for functions.
https://github.com/python/cpython/blob/main/Python/bytecodes.c#L2976
Caching it in the code object is a further optimization.

@netlify
Copy link

netlifybot commentedDec 9, 2022
edited
Loading

Deploy Preview forpython-cpython-preview canceled.

NameLink
🔨 Latest commit2ab0453
🔍 Latest deploy loghttps://app.netlify.com/sites/python-cpython-preview/deploys/6393165aa529f10008d886cf

@markshannon
Copy link
MemberAuthor

Address sanitizer test failing itself because its too slow 🤨

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

@iritkatrieliritkatrieliritkatriel approved these changes

@brandtbucherbrandtbucherAwaiting requested review from brandtbucher

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@markshannon@iritkatriel@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp