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

Break up VM #18

Open
pmenon opened this issue Sep 28, 2019 · 0 comments
Open

Break up VM #18

pmenon opened this issue Sep 28, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@pmenon
Copy link
Owner

pmenon commented Sep 28, 2019

The main interpreter loop here has grown very large. It uses an indirect-threaded VM and inlines decode and dispatch logic for all bytecodes. This approach made sense when the number of bytecodes was small. However, now that we've reached more than 400 bytecodes, having a gigantic function is unmaintainable.

We should consider extracting decode and bytecode logic into separate per-bytecode functions and dispatching to functions rather than go-to labels. The primary concern is the potential drop in performance. I propose we first measure this drop, if any, using a benchmark composed of compute-heavy (i.e., arithmetic, loops, and branching) and SQL-heavy programs.

I suspect we'll identify categories of bytecodes that will we can mark always inline, and those whose invocation frequency and code size don't warrant this.

@pmenon pmenon added the enhancement New feature or request label Sep 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant