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

instruction pointer is problematic #6

Open
brianush1 opened this issue Jan 24, 2020 · 0 comments
Open

instruction pointer is problematic #6

brianush1 opened this issue Jan 24, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@brianush1
Copy link
Owner

The instruction pointer for the VM must be stored per coroutine. However, as D does not offer built-in thread-local storage, it is currently stored in a hashmap with the current Fiber being the key (Solution 1).

An alternative solution (Solution 2), if there were no coroutines in Lua, would be to store a single, global IP.

When comparing 7 runs of solutions 1 and 2, taking the best of 1 and the worst of 2 on the given benchmark.lua file, the times being 375.109 and 184.882 milliseconds respectively, solution 2 outperforms the current solution, being over 2.02 times faster.

More than half the runtime of a given program is spent accessing the instruction pointer. This is not good!

@brianush1 brianush1 added the bug Something isn't working label Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant