Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a357eef6dd9359e1f73662ebc012b2f30c6b51df
      
https://github.com/WebKit/WebKit/commit/a357eef6dd9359e1f73662ebc012b2f30c6b51df
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-07-21 (Tue, 21 Jul 2026)

  Changed paths:
    M Source/JavaScriptCore/runtime/SymbolConstructor.cpp

  Log Message:
  -----------
  [JSC] `Symbol.keyFor` should reuse the symbol's cached description string
https://bugs.webkit.org/show_bug.cgi?id=319843

Reviewed by Yusuke Suzuki.

Serializers call Symbol.keyFor on the same registered symbols while walking an
object graph, and each call allocates a fresh JSString even though Symbol
already caches that string in m_description for Symbol.prototype.description.

Return Symbol::description() instead, since a registered symbol's [[Key]] and
[[Description]] are the same string.

                                    Baseline                  Patched

symbol-key-for-registered       16.4233+-0.1339     ^     14.1917+-0.2452       
 ^ definitely 1.1572x faster

* Source/JavaScriptCore/runtime/SymbolConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to