Commit Graph

18 Commits

Author SHA1 Message Date
Andreas Kling
6564eff91c LibWeb: Heap-allocate SerializationRecord in IndexedDB ObjectStoreRecord
Wrap the SerializationRecord (Vector<u8, 1024>) in an OwnPtr so that
each ObjectStoreRecord is only ~16 bytes instead of ~1040+ bytes.
This makes Vector operations on the records list dramatically cheaper
since memmove now shifts pointers instead of kilobyte-sized buffers.
2026-03-21 08:41:13 -05:00
Andreas Kling
ea5c543322 LibWeb: Use binary search for IndexedDB ObjectStore range removal
Since records are sorted by key, records matching a key range form a
contiguous block. Use binary search to find the range boundaries and
remove the block in one operation, instead of scanning every record
with is_in_range().
2026-03-21 08:41:13 -05:00
Andreas Kling
383366bcf7 LibWeb: Use binary search for IndexedDB ObjectStore key lookup
Use AK::binary_search instead of a linear find_if scan in
has_record_with_key(), taking advantage of the fact that records
are kept sorted by key.
2026-03-21 08:41:13 -05:00
Andreas Kling
9eeb43e265 LibWeb: Use binary search for IndexedDB ObjectStore record insertion
Instead of appending and re-sorting the entire records vector on every
insert (O(n log n)), use binary search to find the correct insertion
position and insert directly (O(log n) comparisons + O(n) shift).
2026-03-21 08:41:13 -05:00
Zaggy1024
547d4eb1f5 LibWeb: Implement IndexedDB request/transaction reverts
To allow these to be reverted, we store mutation logs per object store
in the scope of a readwrite transaction to track the modifications that
were made by it. If a revert is needed, the log is played in reverse to
bring us back to the original state.
2026-03-20 23:59:35 -05:00
Zaggy1024
1b4d93e7a6 LibWeb: Move IDB ObjectStore key mutation into its class 2026-03-20 23:59:35 -05:00
stelar7
839ffd45f3 LibWeb/IDB: Implement retrieve_multiple_items_from_an_object_store 2025-08-27 16:13:25 +02:00
stelar7
fe5d5639ef LibWeb/IDB: Move Records and give more descriptive names 2025-08-27 16:13:25 +02:00
stelar7
ddaae635ac LibWeb/IDB: Implement retrieve_multiple_values_from_an_object_store 2025-05-13 08:27:52 +12:00
stelar7
637f35c0eb LibWeb/IDB: Implement clear_an_object_store 2025-05-08 14:13:21 +01:00
stelar7
81d7f27c73 LibWeb/IDB: Fix record checking using the wrong key comparison 2025-04-29 17:06:17 +02:00
stelar7
18a008d073 LibWeb/IDB: Implement retrieve_a_value_from_an_object_store 2025-04-29 17:06:17 +02:00
stelar7
694375d3ac LibWeb/IDB: Implement count_the_records_in_a_range 2025-04-29 17:06:17 +02:00
stelar7
fb17dae42b LibWeb/IDB: Implement store_a_record_into_an_object_store 2025-04-23 12:31:14 -06:00
stelar7
afe7951af4 LibWeb/IDB: Implement delete_records_from_an_object_store 2025-04-23 12:31:14 -06:00
stelar7
9321ad04c0 LibWeb/IDB: Add internal Index object 2025-04-09 11:48:49 -06:00
stelar7
3879391fa6 LibWeb/IDB: Implement IDBObjectStore::name 2025-03-27 15:47:16 +00:00
stelar7
3c5578cc87 LibWeb/IDB: Add internal ObjectStore type 2025-03-27 15:47:16 +00:00