Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 31d781e3386c2d49388d3c0274abd1baa52f5e28
      
https://github.com/WebKit/WebKit/commit/31d781e3386c2d49388d3c0274abd1baa52f5e28
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-02-03 (Tue, 03 Feb 2026)

  Changed paths:
    A JSTests/microbenchmarks/intl-segmenter-grapheme.js
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/Sources.txt
    A Source/JavaScriptCore/runtime/IntlSegmentDataObject.cpp
    A Source/JavaScriptCore/runtime/IntlSegmentDataObject.h
    M Source/JavaScriptCore/runtime/IntlSegmentIterator.cpp
    M Source/JavaScriptCore/runtime/IntlSegmenter.cpp
    M Source/JavaScriptCore/runtime/IntlSegmenter.h
    M Source/JavaScriptCore/runtime/IntlSegments.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.h

  Log Message:
  -----------
  [JSC] Optimize `Intl.Segmenter` segment data object creation with pre-built 
Structure
https://bugs.webkit.org/show_bug.cgi?id=306853

Reviewed by Yusuke Suzuki.

This patch optimizes the creation of segment data objects returned by
Intl.Segmenter by using pre-built Structures with known property offsets,
similar to the pattern used in RegExpMatchesArray.

                                 TipOfTree                  Patched

intl-segmenter-grapheme       96.5302+-2.6148     ^     79.4703+-1.1308        
^ definitely 1.2147x faster

Test: JSTests/microbenchmarks/intl-segmenter-grapheme.js

* JSTests/microbenchmarks/intl-segmenter-grapheme.js: Added.
(test):
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/runtime/IntlSegmentDataObject.cpp: Added.
(JSC::createSegmentDataObjectStructure):
(JSC::createSegmentDataObjectWithIsWordLikeStructure):
* Source/JavaScriptCore/runtime/IntlSegmentDataObject.h: Added.
(JSC::createSegmentDataObject):
* Source/JavaScriptCore/runtime/IntlSegmentIterator.cpp:
(JSC::IntlSegmentIterator::next):
* Source/JavaScriptCore/runtime/IntlSegmenter.cpp:
(JSC::IntlSegmenter::createSegmentDataObject): Deleted.
* Source/JavaScriptCore/runtime/IntlSegmenter.h:
* Source/JavaScriptCore/runtime/IntlSegments.cpp:
(JSC::IntlSegments::containing):
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::segmentDataObjectStructure):
(JSC::JSGlobalObject::segmentDataObjectWithIsWordLikeStructure):

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



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

Reply via email to