duktape icon indicating copy to clipboard operation
duktape copied to clipboard

A possible performance problem of calling sort function with long array

Open ayuan0828 opened this issue 1 year ago • 0 comments

Version: 2.7.0

Description:

When I run the following test case, I found that duktape is much slower than other js engines,such as quickjs or mujs. I want to know what causes such a big performance difference?

Testcase:

a = [];
a.length = 0xfffff;
a.sort();

Time of duktape:

24781ms

Time of quickjs:

72ms

Time of mujs:

166ms

ayuan0828 avatar Mar 17 '23 07:03 ayuan0828