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

Use a single virtual machine for complex executions #617

Merged
merged 2 commits into from
Aug 21, 2023
Merged

Conversation

udoprog
Copy link
Collaborator

@udoprog udoprog commented Aug 21, 2023

This avoids necessarily having to allocate a virtual machine when dealing with function objects and calls which involve other units or contexts, we simply just maintain the call stack inside of a single virtual machine that might refer to instruction pointers in differing contexts.

Benchmarks indicate that relatively simple cross unit/context function have a 20% performance bump (bench external_functions) on my machine due to this, most of it would be due to avoiding additional allocations which are needed to set up individual stacks for separate context calls:

image

@udoprog udoprog added the enhancement New feature or request label Aug 21, 2023
@udoprog udoprog merged commit 5fd92d3 into main Aug 21, 2023
@udoprog udoprog deleted the reuse-vm-execution branch August 21, 2023 15:02
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

Successfully merging this pull request may close these issues.

1 participant