Bug 1852540 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

There are a few placse in CacheIR.cpp where we attach a stub only if the global already has a certain builtin prototype object. This can cause a performance cliff especially with eager baseline interpreter/jit use (where I noticed this when looking into a fuzz bug).

Fixing this improves the micro-benchmark below from 50 ms to 13 ms for me.
```js
function g() {}
function f() {
    var t = new Date;
    var arr = [1, 2, 3];
    for (var i = 0; i < 10_00_000; i++) {
        if (i > 20) {
            g(...arr);
        }
    }
    print(new Date - t);
}
f();
```
There are a few places in CacheIR.cpp where we attach a stub only if the global already has a certain builtin prototype object. This can cause a performance cliff especially with eager baseline interpreter/jit use (where I noticed this when looking into a fuzz bug).

Fixing this improves the micro-benchmark below from 50 ms to 13 ms for me.
```js
function g() {}
function f() {
    var t = new Date;
    var arr = [1, 2, 3];
    for (var i = 0; i < 10_00_000; i++) {
        if (i > 20) {
            g(...arr);
        }
    }
    print(new Date - t);
}
f();
```

Back to Bug 1852540 Comment 0