Bug 1527843 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.

IonBuilder::createThis is used to create the |this| object for constructor calls in Ion. It takes the slow-path for cross-realm functions but it's not too hard to fix this now that everything else works.

It improves the micro-benchmark below (first number is for the Array constructor, second is a scripted function):

before: 107 ms / 93 ms
after:   95 ms /  9 ms

Of course this is all relative: with --more-compartments both take 600 ms :)

---

function f1() {
    var g = newGlobal();
    var t = new Date;
    for (var i = 0; i < 1000000; i++) {
        arr = new g.Array();
    }
    print(new Date - t);
}
f1();

function f2() {
    var g = newGlobal();
    g.evaluate("function Foo(x) { this.x = x; }");
    var t = new Date;
    for (var i = 0; i < 1000000; i++) {
        obj = new g.Foo(i);
    }
    print(new Date - t);
}
f2();
IonBuilder::createThis is used to create the |this| object for constructor calls in Ion. It takes the slow-path for cross-realm functions but it's not too hard to fix this now that everything else works.

It improves the micro-benchmark below (first number is for the Array constructor, second is a scripted function):
```
before: 107 ms / 93 ms
after:   95 ms /  9 ms
```

Of course this is all relative: with --more-compartments both take 600 ms :)

---
```
function f1() {
    var g = newGlobal();
    var t = new Date;
    for (var i = 0; i < 1000000; i++) {
        arr = new g.Array();
    }
    print(new Date - t);
}
f1();

function f2() {
    var g = newGlobal();
    g.evaluate("function Foo(x) { this.x = x; }");
    var t = new Date;
    for (var i = 0; i < 1000000; i++) {
        obj = new g.Foo(i);
    }
    print(new Date - t);
}
f2();
```

Back to Bug 1527843 Comment 0