Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: be02cb665865d5ff576ba58270478f515de4cad6
      
https://github.com/WebKit/WebKit/commit/be02cb665865d5ff576ba58270478f515de4cad6
  Author: Yusuke Suzuki <[email protected]>
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
    M Source/JavaScriptCore/runtime/IntlCollator.cpp
    M Source/JavaScriptCore/runtime/IntlObject.cpp
    M Source/JavaScriptCore/runtime/IntlObject.h
    M Source/JavaScriptCore/runtime/IntlObjectInlines.h

  Log Message:
  -----------
  [JSC] Optimize DUCET localeCompare fast path
https://bugs.webkit.org/show_bug.cgi?id=246843
rdar://101411702

Reviewed by Ross Kirsling.

This patch simplifies localeCompare DUCET fast path to accelerate performance.

1. We should fallback while trying the fast path instead of scanning all the 
code first since this scanning is anyway costly.
   And fallback is much more costly. So, making fast path faster makes sense.
2. Extend the table of DUCET to avoid boundary checks for 8bit characters.
3. Add fast path for equal strings.

This offers 14% improvement in JetStream2/cdjs.

Before:
    Total Score:  199.831
After:
    Total Score:  227.784

* Source/JavaScriptCore/runtime/IntlCollator.cpp:
(JSC::IntlCollator::compareStrings const):
(JSC::IntlCollator::checkICULocaleInvariants):
* Source/JavaScriptCore/runtime/IntlObject.cpp:
* Source/JavaScriptCore/runtime/IntlObject.h:
* Source/JavaScriptCore/runtime/IntlObjectInlines.h:
(JSC::canUseASCIIUCADUCETComparison):
(JSC::compareASCIIWithUCADUCET):

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to