Skip to content

Cache Slate Search results#1049

Open
c-Caelum wants to merge 2 commits into
FallingColors:mainfrom
c-Caelum:main
Open

Cache Slate Search results#1049
c-Caelum wants to merge 2 commits into
FallingColors:mainfrom
c-Caelum:main

Conversation

@c-Caelum
Copy link
Copy Markdown

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.

@c-Caelum
Copy link
Copy Markdown
Author

c-Caelum commented May 17, 2026

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.

Copy link
Copy Markdown
Member

@Robotgiggle Robotgiggle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@c-Caelum
Copy link
Copy Markdown
Author

Okay. I'll dwell over a way to fix these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋 Backlog

Development

Successfully merging this pull request may close these issues.

2 participants