feel free to close this without doing anything, as it's just a tip.
While reading, I noticed in your example code that you create a new sqlite prepared statement every time you get/set/delete from the cache. I don't know if you did that for brevity or if your actual code looks like that, but it would be faster to reuse that prepared statement every time (that's the beauty of prepared statements, they let you skip the sql string parsing and stuff on subsequent calls )
So this is just a tip for you to change your app code if that is indeed how you're using it, and maybe change your example code so if people copy/paste it, their app also benefits from just preparing it once.
great article Kent!
feel free to close this without doing anything, as it's just a tip.
While reading, I noticed in your example code that you create a new sqlite prepared statement every time you
get
/set
/delete
from the cache. I don't know if you did that for brevity or if your actual code looks like that, but it would be faster to reuse that prepared statement every time (that's the beauty of prepared statements, they let you skip the sql string parsing and stuff on subsequent calls )So this is just a tip for you to change your app code if that is indeed how you're using it, and maybe change your example code so if people copy/paste it, their app also benefits from just preparing it once.