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

Hardcode bytecode length in interpreter loop #56

Merged
merged 1 commit into from Mar 1, 2024

Conversation

smarr
Copy link
Member

@smarr smarr commented Feb 24, 2024

Instead of using the bytecode length array, which is somewhat expensive in the interpreter, use the same approach that TruffleSOM uses and just adjust the bytecode index in each handler as appropriate.

This gives the bytecode interpreter a neat boost. It reduces the run time by 3-22%:

https://rebench.dev/RPySOM/compare/b7acae57068a02418f334fd84a209ac485ba7b98..45380176f78b122482359c54170da031f89a610e#exe-comparisons

This PR also fixes some new Black formatting, and updates to PyPy 7.3.15.

Instead, hardcode the bytecode length. This should avoid another check on each bytecode.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
@smarr
Copy link
Member Author

smarr commented Mar 1, 2024

@smarr smarr merged commit 470bab2 into SOM-st:master Mar 1, 2024
4 checks passed
@smarr smarr deleted the hardcode-bytecode-length branch March 1, 2024 14:07
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.

None yet

1 participant