12012-09-07 Joshua Bell <jsbell@chromium.org>
2
3 IndexedDB: IDBFactory.deleteDatabase() is slow
4 https://bugs.webkit.org/show_bug.cgi?id=96036
5
6 Reviewed by NOBODY (OOPS!).
7
8 The deleteDatabase() operation is implemented by creating a LevelDBTansaction to accumulate
9 the records to delete, then committing it. The transaction is a tree of key/operation pairs.
10 As each (key, delete) entry is added to the tree compares need to be made, potentially
11 requiring full key decodes. Since this temporary transaction is never read from, this is
12 overkill.
13
14 Add a new "write only" transaction type that simply wraps a write batch, which provides
15 transaction integrity but avoids the insertion overhead.
16
17 No new tests - no functional changes, only perf improvement.
18
19 * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
20 (WebCore::IDBLevelDBBackingStore::deleteDatabase): Use new write-only transaction type.
21 * platform/leveldb/LevelDBTransaction.cpp:
22 (WebCore::LevelDBWriteOnlyTransaction::create):
23 (WebCore):
24 (WebCore::LevelDBWriteOnlyTransaction::LevelDBWriteOnlyTransaction):
25 (WebCore::LevelDBWriteOnlyTransaction::~LevelDBWriteOnlyTransaction):
26 (WebCore::LevelDBWriteOnlyTransaction::put):
27 (WebCore::LevelDBWriteOnlyTransaction::remove):
28 (WebCore::LevelDBWriteOnlyTransaction::commit):
29 (WebCore::LevelDBWriteOnlyTransaction::rollback):
30 * platform/leveldb/LevelDBTransaction.h:
31 (WebCore):
32 (LevelDBWriteOnlyTransaction):
33