[webkit-changes] [WebKit/WebKit] 473600: Minor optimizations to SerializedScriptValue

Chris Dumez noreply at github.com
Fri Aug 4 20:16:06 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 473600ff56268ca69413333c0d7ccc611ea5c6d0
      https://github.com/WebKit/WebKit/commit/473600ff56268ca69413333c0d7ccc611ea5c6d0
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
    M LayoutTests/fast/storage/serialized-script-value.html
    M Source/WebCore/bindings/js/SerializedScriptValue.cpp

  Log Message:
  -----------
  Minor optimizations to SerializedScriptValue
https://bugs.webkit.org/show_bug.cgi?id=259794

Reviewed by Ryosuke Niwa and Darin Adler.

Minor optimizations to SerializedScriptValue:
1. Encode boolean values as uint8_t instead of int32_t to save space.
2. Move String in when constructing a CachedString
3. Avoid double HashMap lookup and code duplication in fillTransferMap()

* Source/WebCore/bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::fillTransferMap):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneSerializer::write):
(WebCore::CloneDeserializer::CachedString::CachedString):
(WebCore::CloneDeserializer::read):
(WebCore::CloneDeserializer::readStringData):

Canonical link: https://commits.webkit.org/266612@main




More information about the webkit-changes mailing list