scaljeri / indexeddb-vs-websql Goto Github PK
View Code? Open in Web Editor NEWWebSql vs IndexedDB: performance test
WebSql vs IndexedDB: performance test
for (var i = 0; i < db.objectStoreNames.length; i ++) {
console.info('delete object store: ' + db.objectStoreNames[i]) ;
db.deleteObjectStore(db.objectStoreNames[i]);
}
This will fail for multiple stores, as length will decrease as the stores are deleted while the counter will be incremented. You probably want:
while (db.objectStoreNames.length)
db.deleteObjectStore(db.objectStoreNames[0]);
And the test overall will only test prefixed versions of the API:
idb = getIndexedDBObject( 'IndexedDB' ) ;
function getIndexedDBObject(name) {
return window[name] || window['webkit' + name] || window['moz' + name] || window['ms' + name] ;
}
That will attempt to use window.IndexedDB
but the standard API entry point is window.indexedDB
so this always falls back to a prefixed version, and will break if they are removed.
Hi there, some possible extra things to consider:
readTransaction
should be used instead of regular rw transaction. This might give some small benefit.SELECT
in a single transaction, or multiple transactions each with a single SELECT
. From my experience multiple transactions each with a single-select is about an order of magnitude slower than a single transaction with multiple selects, possibly due to SQLite needing to acquire/release a shared lock each time coupled with whatever internal transaction-level bookkeeping websql does. Would be interesting to see how indexeddb compares for this usage pattern.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.