You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The performance of the Array.pop function is the same as the others, all taking around 100ms. However, the Array.pop operation is exceptionally slow, especially when the array length exceeds 10,000.
let n = 5000;
let a = Array(n).fill(0);
while (a.length) a.pop()
The text was updated successfully, but these errors were encountered:
@jedel1043 How about Array.unshift, unshift and shift functions are quite similar, and both are very slow. Can similar methods be used for optimization?
Array.splice is also a commonly used method for modifying arrays, and it's slow in Boa as well.
let a = [];
let n = 10000;
while(n--) a.splice(0,0,n)
console.log(a)
@jedel1043 How about Array.unshift, unshift and shift functions are quite similar, and both are very slow. Can similar methods be used for optimization?
Array.splice is also a commonly used method for modifying arrays, and it's slow in Boa as well.
let a = [];
let n = 10000;
while(n--) a.splice(0,0,n)
console.log(a)
Yeah, arrays in general need a lot of extra work. I'll open a tracking issue for that.
Describe the bug
Array.shift is very slow
To Reproduce
node 92ms
boa 37s
qjs 45ms
Expected behavior
Array.shift should have better performance
Build environment (please complete the following information):
rustc -V
]Additional context
The performance of the Array.pop function is the same as the others, all taking around 100ms. However, the Array.pop operation is exceptionally slow, especially when the array length exceeds 10,000.
The text was updated successfully, but these errors were encountered: