Skip to content

Commit 4d91355

Browse files
committed
Lower threshold on Array sort
1 parent aec0bc1 commit 4d91355

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

lib/Runtime/Base/JnDirectFields.h

-8
Original file line numberDiff line numberDiff line change
@@ -639,17 +639,10 @@ ENTRY(select)
639639

640640
// JsBuiltIns
641641
ENTRY(__chakraLibrary)
642-
ENTRY(alias)
643-
ENTRY(argumentsCount)
644-
ENTRY(className)
645-
ENTRY(forceInline)
646642
ENTRY(GetIteratorPrototype)
647-
ENTRY(GetLength)
648643
ENTRY(InitInternalProperties)
649-
ENTRY(methodName)
650644
ENTRY(registerChakraLibraryFunction)
651645
ENTRY(registerFunction)
652-
ENTRY(staticMethod)
653646
ENTRY(arraySpeciesCreate)
654647
ENTRY(arrayCreateDataPropertyOrThrow)
655648
ENTRY(Array_values)
@@ -766,7 +759,6 @@ ENTRY2(_newTarget, _u("*new.target*"))
766759
// Note: Do not add fields for conditionally-compiled PropertyIds into this file.
767760
// The bytecode for internal javascript libraries is built on chk but re-used in fre builds.
768761
// Having a mismatch in the number of PropertyIds will cause a failure loading bytecode.
769-
// See BLUE #467459
770762

771763
#undef ENTRY_INTERNAL_SYMBOL
772764
#undef ENTRY_SYMBOL

lib/Runtime/Library/JsBuiltIn/JsBuiltIn.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
}
277277

278278
// for short arrays perform an insertion sort
279-
if (length < 2048) {
279+
if (length < 1024) {
280280
let sortedCount = 1, lowerBound = 0, insertPoint = 0, upperBound = 0;
281281
while (sortedCount < length) {
282282
const item = o[sortedCount];

test/Array/array_sort_random.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ function stressTestSort(iterations, size = 1000)
163163
}
164164
}
165165

166-
// test arrays with length < 2048 for insertion sort
167-
stressTestSort(200, 512);
168-
// test arrays with length > 2048 for merge sort
169-
stressTestSort(200, 2050);
166+
// test arrays with length < 1024 for insertion sort
167+
stressTestSort(100, 512);
168+
// test arrays with length > 1024 for merge sort
169+
stressTestSort(100, 1025);
170170

171171
print("PASS");

0 commit comments

Comments
 (0)