Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IndexedDB performance

Tags:

html

indexeddb

Can anyone point me to an article on, or preferably provide some experience of performance of IndexedDB (ideally in Chrome) - what is the fetch, insert and update performance like?

There seems to be reasonable amount of opinion that its pretty much unusable for data sets of more than a few thousand records but I'm not sure if this isnt just due to a lack of indexing - surely conceptually it cant be slower than web storage as both presumably use key-value storage internally?

Thanks

like image 563
Sidebp Avatar asked Oct 13 '11 19:10

Sidebp


People also ask

Is localStorage faster than IndexedDB?

LocalStorage is slightly faster than IndexedDB in all browsers (disregarding the crashes). IndexedDB is not significantly slower when run in a web worker, and never blocks the DOM that way.

Is IndexedDB deprecated?

The W3C has announced that the Web SQL database is a deprecated local storage specification so web developer should not use this technology any more. indexeddb is an alternative for web SQL data base and more effective than older technologies.

Is it good to use IndexedDB?

As I've alluded to, IndexedDB is a good fit if your client-side data needs are more complex than what Local/SessionStorage can provide (i.e. you're looking for more than a simple Key/Value store in your application). Yes, you can use JavaScript functions (such as JSON. stringify and JSON.

Is IndexedDB persistent?

IndexedDB is a way for you to persistently store data inside a user's browser.


1 Answers

I recently did some performance comparisons between WebSQL and IndexedDB. Surprisingly, IndexedDB won (which I wasn't expecting).

http://blog.oharagroup.net/post/16394604653/a-performance-comparison-websql-vs-indexeddb


Edit: the above URL is down, but available on archive.org: http://web.archive.org/web/20160418233232/http://blog.oharagroup.net/post/16394604653/a-performance-comparison-websql-vs-indexeddb

In summary:

WebSQL takes on average between ~750-850ms to complete the query and render the results; and IndexedDB takes on average ~300-350ms to render the exact same results.

like image 113
Scott Avatar answered Oct 21 '22 10:10

Scott