12012-09-06 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 Instead, expose a new LevelDB::removeRange() method that only creates a LevelDBWriteBatch.
15 This is lighter weight than a LevelDBTransaction, has transactional integrity, and appears
16 faster than calling into leveldb to remove each individual record directly.
17
18 No new tests - no functional changes, only perf improvement.
19
20 * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
21 (WebCore::IDBLevelDBBackingStore::deleteDatabase):
22 * platform/leveldb/LevelDBDatabase.cpp:
23 (WebCore::LevelDBDatabase::removeRange):
24 (WebCore):
25 * platform/leveldb/LevelDBDatabase.h:
26 (LevelDBDatabase):
27