[webkit-changes] [WebKit/WebKit] c4edc1: [JSC] Cache default Intl NumberFormat

Yusuke Suzuki noreply at github.com
Sun May 14 01:17:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c4edc10959902651c35cf3cc5e911c757513058e
      https://github.com/WebKit/WebKit/commit/c4edc10959902651c35cf3cc5e911c757513058e
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-05-14 (Sun, 14 May 2023)

  Changed paths:
    A JSTests/microbenchmarks/number-to-locale-string-default.js
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.h
    M Source/JavaScriptCore/runtime/NumberPrototype.cpp

  Log Message:
  -----------
  [JSC] Cache default Intl NumberFormat
https://bugs.webkit.org/show_bug.cgi?id=256765
rdar://109313080

Reviewed by Ross Kirsling.

Just cache Intl.NumberFormat in the same way to Intl.Collator for Number#toLocaleString,
when locale and options are both undefined.

                                            ToT                     Patched

number-to-locale-string-default      954.4781+-5.3479     ^     12.0671+-0.0603        ^ definitely 79.0979x faster

* JSTests/microbenchmarks/number-to-locale-string-default.js: Added.
(test):
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::defaultNumberFormat const):
* Source/JavaScriptCore/runtime/NumberPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):

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




More information about the webkit-changes mailing list