GH-113464: Speed up JIT builds by brandtbucher · Pull Request #122839 · python/cpython · GitHub
Skip to content

GH-113464: Speed up JIT builds - #122839

Merged
brandtbucher merged 2 commits into
python:mainfrom
brandtbucher:faster-jit-builds
Aug 14, 2024
Merged

GH-113464: Speed up JIT builds#122839
brandtbucher merged 2 commits into
python:mainfrom
brandtbucher:faster-jit-builds

Conversation

@brandtbucher

@brandtbucher brandtbucher commented Aug 8, 2024

Copy link
Copy Markdown
Member

The current JIT build includes the code for every instruction when compiling each stencil, even though only one of the cases is used.

This extracts the desired cases and compiles them each in isolation, which makes JIT builds almost twice as fast (except on Windows, where I suspect we're still bound by subprocess creation time).

@brandtbucher brandtbucher added build The build process and cross-build topic-JIT labels Aug 8, 2024
@brandtbucher brandtbucher self-assigned this Aug 8, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Aug 8, 2024

@savannahostrowski savannahostrowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My only question is how, if at all, memory usage is impacted by this change, given the independent compilation.

Otherwise, this is just a tiny comment about adding a comment.

Comment thread Tools/jit/_targets.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it be good to add a comment here about why each of these is compiled independently (e.g., because of the performance benefit)? I'm not sure that would be abundantly clear if I just stumbled upon this code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea, I'll add a comment.

@brandtbucher

Copy link
Copy Markdown
Member Author

@brandtbucher
brandtbucher merged commit 5118592 into python:main Aug 14, 2024
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build The build process and cross-build skip news topic-JIT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants