Significantly improved performance by adding caching of combinational chips#507
Open
CC56785 wants to merge 6 commits intoSebLague:mainfrom
Open
Significantly improved performance by adding caching of combinational chips#507CC56785 wants to merge 6 commits intoSebLague:mainfrom
CC56785 wants to merge 6 commits intoSebLague:mainfrom
Conversation
added 6 commits
May 30, 2025 17:24
…y activate caching on larger chips.
Contributor
|
Hey is this fully functional without any problems? |
Author
|
Yup, I set it up in a way so that it should exactly mimic the games normal behavior. |
This was referenced Jul 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purely combinational chips, so chips whose outputs entirely depend on their inputs and on nothing else, who also don't have too many input bits, now get cached. This means that a look up table (LUT) with 2^(number of input bits) entries gets created and whenever this chip needs to determine its output, it can just use the LUT to immediately know what its output should be.
This usually gave me a speedup of up to 4x (for example my CPU went from 1500 sps to more than 5000 sps).
Also added some UI in the chip customization menu where the player can decide for medium sized chips whether they should get cached or not.
Also added a little pop up info to give progress information when creating large caches.
Any special cases (like displays, keys, tristated values, view mode, ...) also all get handled correctly (usually by turning off chip caching).