-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SerializedScriptValue could be faster by atomizing strings early in s…
…ome cases https://bugs.webkit.org/show_bug.cgi?id=259267 rdar://112759042 Reviewed by Darin Adler. Upon deserialization, in the `ObjectStartVisitMember` case, we would call `readStringData()` which would allocate a String from the raw characters and we would later construct a JSC::Identifier from it using JSC::Identifier::fromString(), which would then atomize the string. To avoid unnecessary string allocations in the case where the string is already in the AtomString table, we now add a `ShouldAtomize` parameter to `readStringData()`. Then the parameter is `Yes`, it now constructs an AtomString right away instead of allocating a String. As a result, we avoid unnecessary String allocations and the construction of a JSC::Identifier is cheap using an already atomized string. * Source/WebCore/bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::CloneSerializer): (WebCore::CloneDeserializer::deserializeString): (WebCore::CloneDeserializer::readString): (WebCore::CloneDeserializer::readNullableString): (WebCore::CloneDeserializer::readStringData): (WebCore::CloneDeserializer::deserialize): Canonical link: https://commits.webkit.org/266503@main
- Loading branch information
Showing
1 changed file
with
22 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters