Bug 239267

Summary: [JSC] Optimize ArrayPrototype.js::sort
Product: WebKit Reporter: Robin Morisset <rmorisset>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: mrbsayee, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Robin Morisset 2022-04-12 17:33:55 PDT
It currently seems to be a fairly naive merge sort. Making it some kind of Timsort (https://en.wikipedia.org/wiki/Timsort) could be an easy perf win.
Comment 1 Radar WebKit Bug Importer 2022-04-19 17:34:13 PDT
<rdar://problem/91996423>
Comment 2 Raiyan Sayeed 2022-07-04 08:42:33 PDT
Would it make sense to base the Timsort implementation off a full-fledged one (like a Javascript version of the OpenJDK implementation: https://github.com/AdoptOpenJDK/openjdk-jdk11u/blob/master/src/java.base/share/classes/java/util/TimSort.java)? Or would it be better to create a more basic implementation?