GithubHelp home page GithubHelp logo

indexeddb-vs-websql's People

Contributors

cmumford avatar krackers avatar scaljeri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

indexeddb-vs-websql's Issues

idb.js bugs

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.

Improvements to benchmark

Hi there, some possible extra things to consider:

  • For read-single and read-multi, readTransaction should be used instead of regular rw transaction. This might give some small benefit.
  • read-multi currently executes a query that returns multiple rows. Another notion of read-multi would be making several 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.