1

I'm getting into using IndexedDB. Thought I'd grab Parashuram's jQuery wrapper for it.

However, there doesn't seem to be a whole lot of information regarding IndexedDB lying around the internet.

Does anyone know what the I/O speeds are like on IndexedDB, preferably browser-specific? Is there any way to measure it? How would using the jQuery wrapper (as well as the polyfill shim to make it work in Opera/Safari) affect these speeds?

Reason I'm asking is I thought to store snippets of HTML content in the base, but maybe I shouldn't bother if fetching it would take longer than browser cache or similar.

3
  • LocalStorage is in memory object. No db will faster then that
    – Kyaw Tun
    Commented Jan 27, 2013 at 0:15
  • True, but the 5mb limit of localStorage in some browsers is an issue for me. It seems that even though IndexedDB is significantly slower than localStorage, the operations/second is still in the high thousands, so the difference should likely not be noticeable. Or..? Commented Jan 27, 2013 at 0:21
  • 1
    It is async, so it can take whatever it need to do like waiting for user confirmation or waiting io lock. Other than that the raw speed is very fast, around few ms.
    – Kyaw Tun
    Commented Jan 27, 2013 at 1:14

1 Answer 1

1

It depends on the browser your are using.

My experience is that IE 10 is pretty fast, compared to chrome and FireFox. Try my QUnit test I wrote for my framework, and you will really see the difference. Of course this isn't a benchmark test, only test of functionality.

4
  • Interesting... I ran the tests several times, and random tests seem to take a moment longer than the others each run on my Chrome. I also found this: jsperf.com/indexeddb-vs-localstorage/16 which suggests that while IndexedDB definitely kicks WebSQL's ass, it is still 6½ times slower than localStorage. Do you think the difference is noticeable? Only reason I don't use localStorage is its demonstrably minimal maximum size on Chrome et al. Commented Jan 26, 2013 at 14:58
  • 1
    Disadvantage of localstorage is the storage limit of 5mb. Also it doesn't have a structured way to save data. Also you are saving string values in case of localstorage in stead of objects. Last indexeddb provides a way to filter data, with localstorage it is always in memory Commented Jan 26, 2013 at 16:01
  • Do you have any experience with the polyfill shim to make IndexedDB work in Opera/Safari? In those browsers, performance doesn't concern me so much, but I am concerned of the upper limit in storage. Commented Jan 26, 2013 at 16:33
  • The page with my tests includes a the indexeddbshim, so try it out. Several test will fail because the error handling isn't like it is specified in the API. But the green path should work correct. Commented Jan 26, 2013 at 17:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.