-
-
Notifications
You must be signed in to change notification settings - Fork 370
Open
Description
Sparked by #337, the idea is to implement caching of parsed queries so that repeated calls to something like node.select(someQueryString) are only parsed once.
This task is meant to discuss how we want to do that. Main issue is that the caching must be limited: if a user builds dynamic queries which are not reused, a naive boundless cache would be similar to a memory leak.
Current options:
NSCache- As far as I can tell, it should be available on Linux as well.
- Automatically responds to memory pressure on Apple platforms. Not sure about Linux.
- Major downside: it's not sendable.
LRUCache- Automatically responds to memory pressure on iOS, but not yet on macOS?
- Sendable.
- Downside: it's an external dependency. Currently aligns with our deployment targets so should be fine.
LRUCache looks like a good fit.
Some way of configuring the cache would be nice, but in a way that's implementation agnostic so we can switch to a different cache implementation if needed/wanted.
aehlke
Metadata
Metadata
Assignees
Labels
No labels