Closed alercah closed 7 years ago
Hi, that is actually a good point. I am going to do an effort to optimize querying using an in memory db like Bolt. Not sure i should put everything in memory. This is definately on my to do-list.
It's a small enough volume of data that storing it all in memory to begin with probably isn't that bad. Keeping the subdivision data unloaded until needed would be a nice additional optimization, but anything that cuts down on the redundancy would be helpful at this point :)
This makes the library pretty unsuitable for use in real-world applications. Currently, in order to get, e.g., a
Country
's list ofSubdivision
s, it creates a newQuery
every time you call it. This is horribly inefficient.Probably the best way to solve this is make one
Query
and either make it a global variable that is initialized during package initialization, or allow it to be explicitly initialized if that isn't acceptable.