I also added a comment section at the bottom of the page - please do run the tests on your browser and leave your comments about interesting results that you notice.
Link - http://axemclion.github.io/IndexedDB/perf/
p.s: this is not a comparison on IndexedDB vs WebSql vs LocalStorage, or comparing performance between different browsers.
--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html...@chromium.org.
To post to this group, send email to chromiu...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.
For more options, visit https://groups.google.com/a/chromium.org/groups/opt_out.
I wanted to understand the performance characteristics of various operations for IndexedDB for my jquery-indexedDB plugin and wrote up a small test suite for it here - http://axemclion.github.io/IndexedDB/perf/
Thought that this group may be interested in looking at the results and hence sharing with the group. Trying to compare different approaches to do similar things on IndexedDB and tried to make the use cases resemble the code path most applications using IndexedDB would use.
Some interesting findings -
- Firefox, IE and Chrome use different underlying stores and the difference between using LevelDB and SQLite is well pronounced in the results
- It is sometimes faster to batch up read operations in sets of transactions
- cursor.advance is faster than cursor.continue
- (more in the test suits)
I also added a comment section at the bottom of the page - please do run the tests on your browser and leave your comments about interesting results that you notice.
p.s: this is not a comparison on IndexedDB vs WebSql vs LocalStorage, or comparing performance between different browsers.
--
At this time, I am tempted to write more tests that compare IndexedDB and WebSQL, but will stick to just IndexedDB for the moment. :)
@Joshua Bell, those are some interesting test cases.
Pardon my naive question here, but I was looking at your test cases and was did not understand the test harness that you were running it with. I found an automation object, but is there any other framework that ensures that these tests are run multiple frameworks so that the data collected ignores other factors that may impact it ?
The biggest problem that I was having was about making this data statistically significant. Though I use Benchmarkjs, the blocking nature of IndexedDB make the standard deviations pretty large - large enough that minor differences are lesser than standard deviation, to make the test look accurate.
And here is a compile of my test results for the curious.
- Comparing keys is pretty much comparing different objects - numbers being the fastest and nested arrays being the slowest. [LINK]
- Interestingly in Firefox, specifying a version in indexedDB.open() is faster than not specifying a version. I guess they look up the database meta-data when it is not specified. [LINK]
- The presence (or absence) or keypath and auto-increment does not change the speed on add operation. This is interesting as I always thought that auto-inrement, or keypath would slow down the opreations as additional computation would be required. [LINK]
- Adding more stores to a transaction scope does slow down read operations. However, since reads do not block each other, should adding more stores into a read transaction really matter ? [link]
- Adding more stores to a write transaction does slow it down. However, in case of firefox, all writes in one tranasction is actually faster !! [link]
- In chrome, calling put is always faster than calling Add. On other browsers, Add is faster !! [link] No idea why.
- Grouping all read operations in a single transaction is faster than having multiple transaction. However in IE, grouping transaction is definitely faster - is this not supposed to be the general case given that read transactions are non-blocking. [link]
- However, multiple write transactions do slow down things as expected - due to contention issues [link]
- When using Cursors, instead of reading or writing in a single cursor, opening multiple cursors is way faster. Even in case of write, waiting for a cursor to sequentially write is slower than multiple cursors waiting and then writing [link]
- Adding Indexes does not seem to slow the read. What about multi-entry indexes where you would have to fill the index table - should that not be slower ? [link]
- Iterating using the cursors on primary key, or an indexes almost equally fast. [link]
- Getting just the keyCursor on index is faster that getting the entire objectCursor. [link]