IndexedDB 2.0: Key collation during SQLite lookups is insanely slow.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2016 00:25:28 +0000 (00:25 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2016 00:25:28 +0000 (00:25 +0000)
commite1ca331882e04371aa5803ad0a3b54efd556f64c
treeb974ceae422175e1af2f4aafc1e84ab3f9719b00
parent999eca64d946ca4b33dedc1ae402d961dbc5f965
IndexedDB 2.0: Key collation during SQLite lookups is insanely slow.
https://bugs.webkit.org/show_bug.cgi?id=164754

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by *all* existing tests, and unskips a previously-too-slow test)

The new serialization format is straight forward enough to get back with minimal documentation
in a comment with the code itself being the rest of the documentation.

It handles all current IDB key types and leaves room for future key types.

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::setBinaryValue):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::binary):

* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::serializedTypeForKeyType):
(WebCore::writeLittleEndian):
(WebCore::readLittleEndian):
(WebCore::writeDouble):
(WebCore::readDouble):
(WebCore::encodeKey):
(WebCore::serializeIDBKeyData):
(WebCore::decodeKey):
(WebCore::deserializeIDBKeyData):
* Modules/indexeddb/server/IDBSerialization.h:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey): Verify that Type == Invalid
  keys don't get into the database. This was happening before and the previous serialization
  supported it, but there's clearly no point in supporting it with the new serialization.

LayoutTests:

* TestExpectations: Unskip a test that passes even in debug builds, and re-classify
  a test that used to be too-slow everywhere to be too-slow only in debug builds.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBKeyData.cpp
Source/WebCore/Modules/indexeddb/IDBKeyData.h
Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp
Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp