Cache Slate Search results#1049
Open
c-Caelum wants to merge 2 commits into
Open
Conversation
Author
|
However, with the new optimisation of the slate search, this is rather negligible and is likely redundant. I was originally going to make this a small addon with some other opinionated changes, but I decided against it because caching shouldn't have too many drawbacks. |
Robotgiggle
reviewed
May 17, 2026
Member
Robotgiggle
left a comment
There was a problem hiding this comment.
Two potential issues:
- The cache gets invalidated if any BlockCircleComponent is placed or broken anywhere inside the AABB, so if you had a massive circle like a worldslate (which is exactly where you'd want to use the cache to avoid the enormous search time) the cache would be constantly getting invalidated by people building other circles inside it
- I don't know if this would actually have any performance impact, but running through the entire hashmap and checking whether the position is contained in any entries whenever any circle component is placed or broken anywhere seems like it could be kinda slow
Author
|
Okay. I'll dwell over a way to fix these. |
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.
Spell circles' slate search can take time to execute, and caching isn't expensive, so I figured I'd quickly implement caching. This was thrown together pretty quickly, and I'm open to any and all feedback you can give.