New issue
Advanced search Search tips

Issue 651122 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 466053
Owner: ----
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

IndexedDB: Regularly see 20 ms delays between creating tx, issuing get(), and success event

Project Member Reported by jsb...@chromium.org, Sep 28 2016

Issue description

Sample code:

      let request = self.indexedDB.open('db', 1);
      console.log(String(Date.now()) + ' after open');
      request.onsuccess = (event) => {
        console.log(String(Date.now()) + ' open success');
        const db = event.target.result;
        const oneCycle = () => {
          return new Promise(resolve => {
            console.log(String(Date.now()) + ' start retrieving value');
            const transaction = db.transaction('store').objectStore('store');
            transaction.get('key').onsuccess = (event) => {
              console.log(String(Date.now()) + ' got value: ' + event.target.result);
              resolve();
            };
          });
        };
        let promise = Promise.resolve();
        for (let i = 0; i < 50; i++)
          promise = promise.then(oneCycle);
      });

It's common to see 20-30ms between 'start retrieving value' and 'got value'; within a tx the timing is only 2ms per query (which is still high)

This is strange as there should be nothing holding up the tx from starting immediately as it's read-only.
 

Comment 1 by jsb...@chromium.org, Sep 28 2016

Sample that creates the empty store.

On my way-too-powerful desktop machine I see sub-millisecond times reported.
bug_651122.html
904 bytes View Download

Comment 2 by jsb...@chromium.org, Sep 29 2016

Mergedinto: 466053
Status: Duplicate (was: Available)
The problem apparently went away after clearing storage. Sounds like this could be another instance of issue 466053

Sign in to add a comment