libsql / sqld

LibSQL with extended capabilities like HTTP protocol, replication, and more.
https://libsql.org
903 stars 38 forks source link

use LRU cache to store loaded namespaces #689

Open MarinPostma opened 1 year ago

MarinPostma commented 1 year ago

This PR replaces the namespace store dumb hashmap with an LRU cache to bound the maximum number of namespaces loaded into memory while unbounding the number of namespaces allocated on a sqld instance. Additionally, this enables fully concurrent access to namespaces by removing the global lock on the namespace store.