mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 03:27:15 +02:00
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:
committed by
Andreas Kling
parent
ea5c543322
commit
6564eff91c
Notes:
github-actions[bot]
2026-03-21 13:42:23 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/6564eff91c8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8546 Reviewed-by: https://github.com/tcl3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user