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.
This commit is contained in:
Andreas Kling
2026-03-20 23:35:29 -05:00
committed by Andreas Kling
parent ea5c543322
commit 6564eff91c
Notes: github-actions[bot] 2026-03-21 13:42:23 +00:00
6 changed files with 40 additions and 26 deletions

View File

@@ -123,7 +123,7 @@ bool ObjectStore::has_record_with_key(GC::Ref<Key> key)
}) != nullptr;
}
void ObjectStore::store_a_record(ObjectStoreRecord const& record)
void ObjectStore::store_a_record(ObjectStoreRecord record)
{
if (m_mutation_log)
m_mutation_log->note_record_stored(record.key);
@@ -139,7 +139,7 @@ void ObjectStore::store_a_record(ObjectStoreRecord const& record)
else
hi = mid;
}
m_records.insert(lo, record);
m_records.insert(lo, move(record));
}
u64 ObjectStore::count_records_in_range(GC::Ref<IDBKeyRange> range)