Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Add asynchronous support to setup and teardown. #70

Closed
octatone opened this issue Apr 18, 2014 · 9 comments
Closed

Add asynchronous support to setup and teardown. #70

octatone opened this issue Apr 18, 2014 · 9 comments

Comments

@octatone
Copy link

Hello,

I was trying benchmark performance between indexedDB#add and indexedDB#put with the same data sets, but according to this closed issue it is not possible to properly setup with asynchronous function calls in benchmark.js.

IndexedDB is asynchronous only. Opening, creating, CRUD, etc. are all done async in the browser.

Ideally my benchmark would look something like this pseudocode:

setup = function () {
  // open database connection/create db
  // create store
  // populate benchmark data
}

teardown = function () {
  // delete database
  // close db connection
}

test1 = function add () {
  // get transaction request
  // while (data) request.add
}

test1 = function put () {
  // get transaction request
  // while (data) request.put
}

I propose adding support for asynchronous for setup and teardown as more and more modern browser apis are async only.

@octatone
Copy link
Author

Actually as a weekend project, I will start implementing this in a fork ...

@nolanlawson
Copy link

@octatone: If you implemented this in a fork, that's awesome, and we'd be very interested at @pouchdb. We need something that can do async tests of indexedDB/websql and guarantee statistically significant results.

As for indexedDB's objectStore.put vs. objectStore.add, by coincidence I looked into this myself last night, so you may be interested in this: pouchdb/pouchdb#1977 (comment).

@jdalton
Copy link
Member

jdalton commented Apr 18, 2014

@octatone If you get it working I'd accept a PR for sure on it.

@octatone
Copy link
Author

@jdalton I've forked, and started wrapping my head around the current deferred constructor for async benchmarks. We'll see see how far I get over the weekend..

@chesleybrown
Copy link

Guess you never got very far over the weekend...? 😢

@superkhau
Copy link

👍

@vjpr
Copy link

vjpr commented Oct 25, 2015

+1

1 similar comment
@elyas-bhy
Copy link

+1

@jdalton
Copy link
Member

jdalton commented Nov 4, 2016

Moved to #174.

@jdalton jdalton closed this as completed Nov 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

7 participants