Lawnchair all adapters (v12)

Revision 12 of this benchmark created on


Description

Comparing the speed of using a local SQLite database versus window.localStorage to store key/value pairs using Lawnchair.

Preparation HTML

<script src="https://rawgithub.com/cscott/lawnchair/master/src/Lawnchair.js"></script>
<script src="https://rawgithub.com/cscott/lawnchair/master/src/adapters/dom.js"></script>
<script src="https://rawgithub.com/cscott/lawnchair/master/src/adapters/webkit-sqlite.js"></script>
<script src="https://rawgithub.com/cscott/lawnchair/master/src/adapters/indexed-db.js"></script>
<script src="https://rawgithub.com/cscott/lawnchair/master/src/adapters/memory.js"></script>

Setup

var lawnchair = Lawnchair;
    var adapter = '';

Teardown


    lawnchair({name:'people', record:'person', adapter: adapter}, function() {
      this.nuke();
    });
  

Test runner

Ready to run.

Testing in
TestOps/sec
DOM
// async test
adapter = 'dom';
lawnchair({name:'people', record:'person', adapter: adapter}, function() {
  this.save({key:'brian'}, function() { this.get('brian', function() { deferred.resolve(); }); });
});
ready
Memory
// async test
adapter = 'memory';
lawnchair({name:'people', record:'person', adapter: adapter}, function() {
  this.save({key:'brian'}, function() { this.get('brian', function() { deferred.resolve(); }); });
});
ready
IndexedDB
// async test
adapter = 'indexed-db';
lawnchair({name:'people', record:'person', adapter: adapter}, function() {
  this.save({key:'brian'}, function() { this.get('brian', function() { deferred.resolve(); }); });
});
ready
SQL
// async test
adapter = 'webkit-sqlite';
lawnchair({name:'people', record:'person', adapter: adapter}, function() {
  this.save({key:'brian'}, function() { this.get('brian', function() { deferred.resolve(); }); });
});
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.