More benchmarks #23
rhashimoto
started this conversation in
Show and tell
Replies: 1 comment 10 replies
-
Interesting results 🤔 To my understanding the OPFS is meant to be an high-performance interface for storing data, how is it possible that in the benchmark inserts are 1000x slower than when storing the database in memory? |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I implemented the benchmarks from this SQLite page. The page is old (SQLite 2.7.6 is from 2003) but the benchmark operations themselves are still interesting. The benchmarks can be found at demo/benchmarks/, and are online here.
The benchmark page runs the same 16 tests with different builds and VFS classes. The combinations can be specified by modifying the query parameter values on the page URL. The link above includes these configurations:
I changed one benchmark from the SQLite page. The original Test 7 is not wrapped in a transaction and I added one. I did this because Test 7 should be compared with Test 4 - SELECT with/without an index - and Test 4 uses a single transaction.
To run the benchmarks, first change the preamble SQL to set up any options, e.g. type of journaling, locking, etc., then click the Start button. You may need to be patient (especially with Test 1); completing the table can take a couple minutes or more.
Note that artificial benchmarks like this one are typically poor predictors of application performance because an application workload will rarely (if ever) be anything like this. In addition, this benchmark run as-is with the same preamble can't be fair because different VFS classes need different PRAGMA settings for best results. It is a tool that can be both informative and misleading, and needs to be applied and interpreted with some care.
Beta Was this translation helpful? Give feedback.
All reactions