Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-108113: Make it possible to optimize an AST #108282

Merged
merged 2 commits into from
Aug 23, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Aug 22, 2023

@iritkatriel
Copy link
Member Author

Skipping news as the previous PR's news covers this.

@@ -804,25 +804,39 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename,
if (is_ast == -1)
goto error;
if (is_ast) {
PyArena *arena = _PyArena_New();
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if anyone has perf-sensitive code that does ast.parse on an AST as a no-op, and what the impact on that code will be of allocating and freeing an unused arena. Probably not an issue? I think it would be possible, but slightly more complex, to still avoid arena allocation in the no-op case.

@iritkatriel iritkatriel changed the title gh-108113: Make it possible to optimize and AST gh-108113: Make it possible to optimize an AST Aug 23, 2023
@iritkatriel iritkatriel merged commit 2dfbd4f into python:main Aug 23, 2023
@bedevere-bot
Copy link

There's a new commit after the PR has been approved.

@carljm: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from carljm August 23, 2023 08:01
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.

3 participants