Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ecb783a152dc3747a2da39408d7d9a07a41a8815
      
https://github.com/WebKit/WebKit/commit/ecb783a152dc3747a2da39408d7d9a07a41a8815
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-04-30 (Thu, 30 Apr 2026)

  Changed paths:
    A JSTests/microbenchmarks/bigint64-array-last-index-of-large.js
    A JSTests/microbenchmarks/bigint64-array-last-index-of-medium.js
    A JSTests/microbenchmarks/bigint64-array-last-index-of-small.js
    A JSTests/microbenchmarks/biguint64-array-last-index-of-large.js
    A JSTests/microbenchmarks/biguint64-array-last-index-of-medium.js
    A JSTests/microbenchmarks/biguint64-array-last-index-of-small.js
    A JSTests/microbenchmarks/float32-array-last-index-of-large.js
    A JSTests/microbenchmarks/float32-array-last-index-of-medium.js
    A JSTests/microbenchmarks/float32-array-last-index-of-small.js
    A JSTests/microbenchmarks/float64-array-last-index-of-large.js
    A JSTests/microbenchmarks/float64-array-last-index-of-medium.js
    A JSTests/microbenchmarks/float64-array-last-index-of-small.js
    A JSTests/microbenchmarks/int16-array-last-index-of-large.js
    A JSTests/microbenchmarks/int16-array-last-index-of-medium.js
    A JSTests/microbenchmarks/int16-array-last-index-of-small.js
    A JSTests/microbenchmarks/int32-array-last-index-of-large.js
    A JSTests/microbenchmarks/int32-array-last-index-of-medium.js
    A JSTests/microbenchmarks/int32-array-last-index-of-small.js
    A JSTests/microbenchmarks/int8-array-last-index-of-large.js
    A JSTests/microbenchmarks/int8-array-last-index-of-medium.js
    A JSTests/microbenchmarks/int8-array-last-index-of-small.js
    A JSTests/microbenchmarks/typed-array-lastIndexOf-empty.js
    A JSTests/microbenchmarks/uint16-array-last-index-of-large.js
    A JSTests/microbenchmarks/uint16-array-last-index-of-medium.js
    A JSTests/microbenchmarks/uint16-array-last-index-of-small.js
    A JSTests/microbenchmarks/uint32-array-last-index-of-large.js
    A JSTests/microbenchmarks/uint32-array-last-index-of-medium.js
    A JSTests/microbenchmarks/uint32-array-last-index-of-small.js
    A JSTests/microbenchmarks/uint8-array-last-index-of-large.js
    A JSTests/microbenchmarks/uint8-array-last-index-of-medium.js
    A JSTests/microbenchmarks/uint8-array-last-index-of-small.js
    A JSTests/microbenchmarks/uint8-clamped-array-last-index-of-large.js
    A JSTests/microbenchmarks/uint8-clamped-array-last-index-of-medium.js
    A JSTests/microbenchmarks/uint8-clamped-array-last-index-of-small.js
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h
    M Source/WTF/wtf/SIMDHelpers.h
    M Source/WTF/wtf/text/StringCommon.h

  Log Message:
  -----------
  [JSC] Add TypedArray#lastIndexOf optimization
https://bugs.webkit.org/show_bug.cgi?id=313707
rdar://175904377

Reviewed by Yijia Huang.

We added reverseFind families for fp numbers, and then use them in
TypedArray#lastIndexOf. This is well-aligned to TypedArray#indexOf optimization.

                                                         ToT                    
 Patched

    uint32-array-last-index-of-medium               0.3030+-0.0352            
0.2276+-0.0522          might be 1.3315x faster
    int16-array-last-index-of-medium               11.2249+-0.3554     ^      
2.0253+-0.0690        ^ definitely 5.5424x faster
    int32-array-last-index-of-large               567.2856+-0.6059     ^    
165.9670+-4.8270        ^ definitely 3.4181x faster
    int16-array-last-index-of-large               566.6340+-1.3116     ^     
85.4925+-1.0674        ^ definitely 6.6279x faster
    biguint64-array-last-index-of-large           746.6768+-1.1196     ^    
420.6055+-4.1806        ^ definitely 1.7752x faster
    int32-array-last-index-of-medium                0.3292+-0.0401     ^      
0.2260+-0.0451        ^ definitely 1.4567x faster
    int32-array-last-index-of-small                 0.1973+-0.0383            
0.1863+-0.0417          might be 1.0590x faster
    biguint64-array-last-index-of-small             0.1907+-0.0457     ?      
0.2070+-0.0160        ? might be 1.0854x slower
    float32-array-last-index-of-medium              0.3240+-0.0146     ^      
0.2488+-0.0345        ^ definitely 1.3023x faster
    uint16-array-last-index-of-medium              11.1243+-0.5143     ^      
1.9501+-0.0818        ^ definitely 5.7045x faster
    int16-array-last-index-of-small                 0.3291+-0.0211     ?      
0.3650+-0.0216        ? might be 1.1091x slower
    uint8-array-last-index-of-medium               11.1230+-0.0383     ^      
1.4262+-0.0577        ^ definitely 7.7990x faster
    float64-array-last-index-of-small               0.2112+-0.0060     ^      
0.1971+-0.0043        ^ definitely 1.0718x faster
    float64-array-last-index-of-large             575.3604+-4.8133     ^    
234.7345+-1.9510        ^ definitely 2.4511x faster
    float32-array-last-index-of-large             571.8342+-5.7791     ^    
119.8253+-1.2086        ^ definitely 4.7722x faster
    uint16-array-last-index-of-large              569.0002+-7.9021     ^     
85.2038+-0.6646        ^ definitely 6.6781x faster
    uint8-clamped-array-last-index-of-medium       11.2017+-0.2085     ^      
1.4171+-0.0261        ^ definitely 7.9046x faster
    uint32-array-last-index-of-large              567.3750+-1.1759     ^    
163.4587+-0.4689        ^ definitely 3.4711x faster
    biguint64-array-last-index-of-medium            0.3577+-0.0311     ^      
0.2677+-0.0400        ^ definitely 1.3361x faster
    uint16-array-last-index-of-small                0.3617+-0.0602            
0.3481+-0.0461          might be 1.0391x faster
    float32-array-last-index-of-small               0.1862+-0.0287     ?      
0.2023+-0.0404        ? might be 1.0862x slower
    uint32-array-last-index-of-small                0.1996+-0.0387            
0.1899+-0.0338          might be 1.0508x faster
    int8-array-last-index-of-small                  0.3448+-0.0281            
0.3239+-0.0240          might be 1.0646x faster
    int8-array-last-index-of-medium                11.0264+-0.3901     ^      
1.4152+-0.0692        ^ definitely 7.7913x faster
    int8-array-last-index-of-large                566.6000+-3.0132     ^     
53.8640+-0.7808        ^ definitely 10.5191x faster
    uint8-array-last-index-of-small                 0.3303+-0.0488     ?      
0.3346+-0.0158        ? might be 1.0129x slower
    bigint64-array-last-index-of-small              0.1859+-0.0314            
0.1855+-0.0272
    bigint64-array-last-index-of-medium             0.3650+-0.0139     ^      
0.2827+-0.0444        ^ definitely 1.2910x faster
    uint8-array-last-index-of-large               566.7697+-3.2210     ^     
53.5338+-0.3509        ^ definitely 10.5871x faster
    bigint64-array-last-index-of-large            746.7503+-0.8889     ^    
417.3829+-1.1634        ^ definitely 1.7891x faster
    uint8-clamped-array-last-index-of-small         0.3332+-0.0515     ?      
0.3569+-0.0373        ? might be 1.0713x slower
    float64-array-last-index-of-medium              0.3312+-0.0255     ^      
0.2532+-0.0395        ^ definitely 1.3080x faster
    uint8-clamped-array-last-index-of-large       565.7103+-0.6944     ^     
55.5995+-2.3503        ^ definitely 10.1747x faster

Tests: JSTests/microbenchmarks/bigint64-array-last-index-of-large.js
       JSTests/microbenchmarks/bigint64-array-last-index-of-medium.js
       JSTests/microbenchmarks/bigint64-array-last-index-of-small.js
       JSTests/microbenchmarks/biguint64-array-last-index-of-large.js
       JSTests/microbenchmarks/biguint64-array-last-index-of-medium.js
       JSTests/microbenchmarks/biguint64-array-last-index-of-small.js
       JSTests/microbenchmarks/float32-array-last-index-of-large.js
       JSTests/microbenchmarks/float32-array-last-index-of-medium.js
       JSTests/microbenchmarks/float32-array-last-index-of-small.js
       JSTests/microbenchmarks/float64-array-last-index-of-large.js
       JSTests/microbenchmarks/float64-array-last-index-of-medium.js
       JSTests/microbenchmarks/float64-array-last-index-of-small.js
       JSTests/microbenchmarks/int16-array-last-index-of-large.js
       JSTests/microbenchmarks/int16-array-last-index-of-medium.js
       JSTests/microbenchmarks/int16-array-last-index-of-small.js
       JSTests/microbenchmarks/int32-array-last-index-of-large.js
       JSTests/microbenchmarks/int32-array-last-index-of-medium.js
       JSTests/microbenchmarks/int32-array-last-index-of-small.js
       JSTests/microbenchmarks/int8-array-last-index-of-large.js
       JSTests/microbenchmarks/int8-array-last-index-of-medium.js
       JSTests/microbenchmarks/int8-array-last-index-of-small.js
       JSTests/microbenchmarks/typed-array-lastIndexOf-empty.js
       JSTests/microbenchmarks/uint16-array-last-index-of-large.js
       JSTests/microbenchmarks/uint16-array-last-index-of-medium.js
       JSTests/microbenchmarks/uint16-array-last-index-of-small.js
       JSTests/microbenchmarks/uint32-array-last-index-of-large.js
       JSTests/microbenchmarks/uint32-array-last-index-of-medium.js
       JSTests/microbenchmarks/uint32-array-last-index-of-small.js
       JSTests/microbenchmarks/uint8-array-last-index-of-large.js
       JSTests/microbenchmarks/uint8-array-last-index-of-medium.js
       JSTests/microbenchmarks/uint8-array-last-index-of-small.js
       JSTests/microbenchmarks/uint8-clamped-array-last-index-of-large.js
       JSTests/microbenchmarks/uint8-clamped-array-last-index-of-medium.js
       JSTests/microbenchmarks/uint8-clamped-array-last-index-of-small.js

* JSTests/microbenchmarks/bigint64-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/bigint64-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/bigint64-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/biguint64-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/biguint64-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/biguint64-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/float32-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/float32-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/float32-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/float64-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/float64-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/float64-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/int16-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/int16-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/int16-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/int32-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/int32-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/int32-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/int8-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/int8-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/int8-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/typed-array-lastIndexOf-empty.js: Added.
* JSTests/microbenchmarks/uint16-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/uint16-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/uint16-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/uint32-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/uint32-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/uint32-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/uint8-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/uint8-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/uint8-array-last-index-of-small.js: Added.
(test):
* JSTests/microbenchmarks/uint8-clamped-array-last-index-of-large.js: Added.
(test):
* JSTests/microbenchmarks/uint8-clamped-array-last-index-of-medium.js: Added.
(test):
* JSTests/microbenchmarks/uint8-clamped-array-last-index-of-small.js: Added.
(test):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::typedArrayLastIndexOfImpl):
(JSC::genericTypedArrayViewProtoFuncLastIndexOf):
* Source/WTF/wtf/SIMDHelpers.h:
(WTF::SIMD::load):
* Source/WTF/wtf/text/StringCommon.h:
(WTF::reverseFind64):
(WTF::reverseFindFloat16):
(WTF::reverseFindFloat):
(WTF::reverseFindDouble):

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



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

Reply via email to