4 ms·
> best-in-class memory overhead Was using indexeddb considered? I've yet to see an easy to use library that allows you to store simple but large json in indexe
by bhl 4y ago
> best-in-class memory overhead
Was using indexeddb considered? I've yet to see an easy to use library that allows you to store simple but large json in indexeddb, and then query against that. Useful for something as simple as an emoji picker which needs to store keywords or aliases.
- leeoniya 4y agonot sure this would be less overhead than having all strings in memory. you gotta get them into memory anyhow, right? i mean, you can store it in localstorage or wherever to save net transfer for repeated use, but i dont think it would be faster to use indexdb directly at runtime.
- netghost 4y agoI think indexeddb is somewhat orthogonal to this library. The memory efficiency you might get would be that you don't need to hold the whole dataset in memory while running the filter step though at the moment it looks like it assumes you're working with an array in memory (https://github.com/leeoniya/uFuzzy/blob/main/src/uFuzzy.js#L133-L134 https://github.com/leeoniya/uFuzzy/blob/main/src/uFuzzy.js#L...). That said I suspect there distance between this and something that could search against a stream of data is pretty short.