-
-
Notifications
You must be signed in to change notification settings - Fork 93
Optimize flush performance and refactor backend with execution context #206
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
base: master
Are you sure you want to change the base?
Conversation
|
From a few quick tests on my laptop and this seems to have comparable performance to my implementation (https://github.com/BramOtte/MCHPRS/tree/changed-vec) I ran iris mandelbrot at 50'000 ticks per flush and got these results: |
|
Thanks for testing. I still haven't set up my benchmark environment again, so I just prayed my changes would work just as well as yours did. Someone should also probably verify what impact the inline vec size has, although I feel like this was done already (Probably should be its own PR if I am being honest). |
8b80097 to
dee4dbd
Compare
|
Decided it's a good idea to separate this. I will open a separate PR for the node struct change. Although it will cause a merge conflict, as far as I can see. Just ping me and I will rebase either one. |
|
Some ideas for changes:
EDIT: One reason idea 2 is questionable is that we can imagine a future backend that runs ticks asynchronously (for example a multi-threaded or FPGA based one). The change would then remove our "sync point" where we ensure the ticks actually ran and mess with our ability to analyze how long it took to execute these ticks. Although there must be a better way to handle this. |
This PR introduces several optimizations and refactoring improvements to the redpiler backend:
Changes:
ExecutionContext(also contains the new changes vec)Nodelayout was a bit weird, we were wasting 18 bytes on padding. By reducing the updates inline vec from 10 to 9 entries we save 16 bytes (alternative being, adding 3 entries for free).The flush optimization reduces overhead by only processing nodes that have actually changed, which should improve performance especially for large redstone circuits.
We also still have the bug where the reset function does not properly sync all components block state.
To further optimze it, I also decided to just skip syncing the comparators block entities as we weren't properly doing is anyways at the moment.
This should probably be addressed in a different PR.