perf: cache prepared SQL statements #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/cache-prepared-statements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
stmt()helper that caches prepared statements by SQL string, eliminating query recompilation on every callexec()calls ininitDB()into a single callcloseDB()and afterinitDB()Impact
Every function that queries the database (
getStations,getLatestPrices,getPriceHistory,savePricesBatch, etc.) now reuses its prepared statement instead of creating a new one on each invocation. This avoids SQLite query parsing overhead on every request.8e52b6e9c0tobb9da51aec