haikuwebkit/PerformanceTests/IndexedDB
Sihui Liu 8227a5f6dd IndexedDB: speed up index records deletion
https://bugs.webkit.org/show_bug.cgi?id=206196
PerformanceTests:

Reviewed by Brady Eidson.

* IndexedDB/basic/index-cursor-delete-2.html: Added.

Source/WebCore:

<rdar://problem/53596307>

Reviewed by Brady Eidson.

This patch does a few things to accelerate deletion for index records:
1. make indexID unique in database instead of objectStore
2. create an index on IndexRecords table
3. optimize some SQLite statements to take advantage of 1 and 2

Test: IndexedDB.IDBObjectStoreInfoUpgradeToV2

Make test PerformanceTests/IndexedDB/basic/index-cursor-delete-2.html 7.5x faster.

* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::createV1ObjectStoreInfoSchema):
(WebCore::IDBServer::createV2ObjectStoreInfoSchema):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsRecordIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidObjectStoreInfoTable):
(WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteOneIndexRecord): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::buildIndexStatement):
(WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::createIndex):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
(WebCore::IDBDatabaseInfo::setMaxIndexID):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
(WebCore::IDBDatabaseInfo::generateNextIndexID):
(WebCore::IDBDatabaseInfo::encode const):
(WebCore::IDBDatabaseInfo::decode):
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::createNewIndex):
(WebCore::IDBObjectStoreInfo::addExistingIndex):
(WebCore::IDBObjectStoreInfo::isolatedCopy const):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::autoIncrement const):
(WebCore::IDBObjectStoreInfo::encode const):
(WebCore::IDBObjectStoreInfo::decode):
(WebCore::IDBObjectStoreInfo::maxIndexID const): Deleted.

Tools:

Reviewed by Brady Eidson.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/IDBObjectStoreInfoUpgrade.sqlite3: Added.
* TestWebKitAPI/Tests/WebKitCocoa/IDBObjectStoreInfoUpgradeToV2.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/IDBObjectStoreInfoUpgradeToV2.mm: Added.
(-[IDBObjectStoreInfoUpgradeToV2MessageHandler userContentController:didReceiveScriptMessage:]):
(TEST):


Canonical link: https://commits.webkit.org/219924@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-28 23:17:33 +00:00
..
basic IndexedDB: speed up index records deletion 2020-01-28 23:17:33 +00:00
stress