Changeset 130338 in webkit


Ignore:
Timestamp:
Oct 3, 2012, 4:13:56 PM (13 years ago)
Author:
jsbell@chromium.org
Message:

IndexedDB: Don't do full commit for empty transactions
https://bugs.webkit.org/show_bug.cgi?id=89239

Reviewed by Tony Chang.

Don't bother creating a leveldb write batch if there's nothing in the transaction
to commit. Note that a read-only transaction may still have index cleanup so may
not be an empty transaction.

This cuts the Lookup2 benchmark in http://reyesr.github.com/html5-storage-benchmark/
from 70s to 2s.

Covered by existing tests, e.g. storage/indexeddb/transaction-basics.html

  • platform/leveldb/LevelDBTransaction.cpp:

(WebCore::LevelDBTransaction::commit):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r130336 r130338  
     12012-10-03  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Don't do full commit for empty transactions
     4        https://bugs.webkit.org/show_bug.cgi?id=89239
     5
     6        Reviewed by Tony Chang.
     7
     8        Don't bother creating a leveldb write batch if there's nothing in the transaction
     9        to commit. Note that a read-only transaction may still have index cleanup so may
     10        not be an empty transaction.
     11
     12        This cuts the Lookup2 benchmark in http://reyesr.github.com/html5-storage-benchmark/
     13        from 70s to 2s.
     14
     15        Covered by existing tests, e.g. storage/indexeddb/transaction-basics.html
     16
     17        * platform/leveldb/LevelDBTransaction.cpp:
     18        (WebCore::LevelDBTransaction::commit):
     19
    1202012-10-03  Adam Klein  <adamk@chromium.org>
    221
  • trunk/Source/WebCore/platform/leveldb/LevelDBTransaction.cpp

    r128136 r130338  
    126126{
    127127    ASSERT(!m_finished);
     128
     129    if (m_tree.is_empty()) {
     130        m_finished = true;
     131        return true;
     132    }
     133
    128134    OwnPtr<LevelDBWriteBatch> writeBatch = LevelDBWriteBatch::create();
    129135
Note: See TracChangeset for help on using the changeset viewer.