-
Notifications
You must be signed in to change notification settings - Fork 116
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
Speed up CPU #20
Comments
Quick update: Array access optimization Golang issue tracking jump tables |
Hey @ear7h, this is really interesting. I've thought about using this method before but never got around to benchmarking it. It would be great if we could compare the three methods of doing it. From recent experience with optimising the PPU I'm pretty sure that I think it would be good to find some of the places where slices are used instead of arrays - I imagine there are a few cases where I have done this. |
My PR has the |
Thats fair, thanks for contributing! There is a builtin benchmarking library into go which is good to use. I added a benchmark to #21 which just randomly calls opcodes on a blank rom. I feel like that gets a good example of the |
Closing as this was implemented in #21. |
Just found this project and saw one of you goals was to speed up the CPU, I think I found an optimization that can be made in the following function. Currently there is a switch statement but I think a lookup table in the form of a
map[byte]func(*Gameboy)
or[numOpCodes]func(*Gameboy)
(static size array) would be more efficient.goboy/pkg/gb/instructions.go
Lines 70 to 71 in f9f78a9
The text was updated successfully, but these errors were encountered: