Quote:
Originally Posted by cbk1994
Data stored in SQLite tables is not stored in memory, so it takes longer to get that data.
|
I think this is a little overly general.
To refine it a little for anyone who is interested:
- Indexes are stored in memory. This means that looking up the rows you need will be fast, only reading it after finding it will be slow.
- But, even reading the rows won't neccessarily be slow either, since SQLite keeps a cache of a bunch of rows in memory at all times. When reading hot (frequently/recently accessed) data, it'll be from memory.
Similarly, writes are done into memory, and the way Graal's SQLite stuff is set up is that it doesn't wait to write to disk before returning. So a write will just take as long as writing anything into memory.
But even with this, if you need the guarantee that something will be in memory, it's a good idea to keep it in a regular ol' client variable since you may not want the lag if the data is cold and its needed for something important (e.g., sword strength or something which needs to be there in real time).
But yeah, complexity. It may not be worth all this.