This micro-benchmark for `Array.prototype.filter` improves from ~312 ms to ~163 ms: ```js function f() { var arr = Array(100).fill(123); var res; var t = new Date; for (var i = 0; i < 100_000; i++) { res = arr.filter(x => x > 100).filter(x => x > 120).filter(x => x < 0); } print(new Date - t); return res; } f(); ``` And this one for `TypedArray.prototype.findIndex` from ~193 ms to ~54 ms: ```js function f() { var ta = new Int32Array(100); ta[90] = 123; var res; var t = new Date; for (var i = 0; i < 100_000; i++) { res = ta.findIndex(x => x > 0) + ta.findIndex(x => x < 0) + ta.findIndex(x => x === 123); } print(new Date - t); return res; } f(); ```
Bug 1809180 Comment 3 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
This micro-benchmark for `Array.prototype.filter` improves from ~312 ms to ~163 ms: ```js function f() { var arr = Array(100).fill(123); var res; var t = new Date; for (var i = 0; i < 100_000; i++) { res = arr.filter(x => x > 100).filter(x => x > 120).filter(x => x < 0); } print(new Date - t); return res; } f(); ``` And this one for `%TypedArray%.prototype.findIndex` from ~193 ms to ~54 ms: ```js function f() { var ta = new Int32Array(100); ta[90] = 123; var res; var t = new Date; for (var i = 0; i < 100_000; i++) { res = ta.findIndex(x => x > 0) + ta.findIndex(x => x < 0) + ta.findIndex(x => x === 123); } print(new Date - t); return res; } f(); ```