Pre-compute `Collection`-related `Search` keys
Closed this issue · 1 comments
hinto-janai commented
What
Search currently starts with a cache of 0 keys, and only acquires them as the user sends input.
We already have a bunch of String
's of the user's music data and could pre-compute some search Keychain
's with them.
Pros
- All user-related data will already be cached; their data in particular will have fast response times
Cons
- More memory usage
Search
may lag behind after theCollection
creation depending on how long and how manyKeychain
's we make
Potential workarounds
This could be combined with #10 and a new "Search cache" phase could be introduced in the CCD
process, with maybe even the resulting HashMap
being embedded within the Collection
itself.
The process can also easily be run in parallel:
.chunk()
on the keys, spawn threads- Run search algo
- Either lock and push with
Mutex
or - Join and flatten each thread's individual results
hinto-janai commented
Search is now much faster, this is no longer needed.