HTML Preparation code:
x
 
1
<script>
2
    function fn1() {
3
4
        const a = new Object();
5
        a.val1 = 1;
6
        a.val2 = 2;
7
        a.f0 = () => a.val1 + a.val2;
8
        return a;
9
    }
10
11
    function fn2() {
12
13
        const a = new Function();
14
        a.val1 = 1;
15
        a.val2 = 2;
16
        a.f0 = () => a.val1 + a.val2;
17
        return a;
18
    }
19
20
    const f0 = function() {
21
        console.log(this.val1 + this.val2);
22
    };
23
24
25
    function fn3() {
26
27
        const a = {};
28
        let f1 = f0.bind(a);
29
        a.val1 = 1;
30
        a.val2 = 2;
31
        return f1;
32
    }
33
    class BB {
34
        get name() {
35
            return 'hi'
36
        }
37
    }
38
    const BBp = BB.prototype;
39
40
    BBp.val1 = 1;
41
    BBp.val2 = 2;
42
43
    function fn4() {
44
45
        const a = () => {};
46
        Object.setPrototypeOf(a, BBp);
47
48
        return a;
49
    }
50
51
    function fn5() {
52
53
        const a = () => {};
54
        a.prototype = BBp;
55
56
        return a;
57
    }
58
    let m = new Float64Array(256);
59
60
    function fn6() {
61
        const a = {};
62
        a.b = m.subarray(0, 64);
63
        return a;
64
    }
65
  
66
    function fn7() {
67
        const a = {};
68
        Object.defineProperty(a, 'b', {get: ()=> m.subarray(0, 64)})
69
        return a;
70
    }
71
</script>
Tests:
  • test1

     
    fn1();fn1();fn1();fn1();fn1();fn1();fn1();fn1();fn1();fn1();
  • test2

     
    fn2();fn2();fn2();fn2();fn2();fn2();fn2();fn2();fn2();fn2();
  • test3

     
    fn3();fn3();fn3();fn3();fn3();fn3();fn3();fn3();fn3();fn3();
  • test4

     
    fn4();fn4();fn4();fn4();fn4();fn4();fn4();fn4();fn4();fn4();
  • test5

     
    fn5();fn5();fn5();fn5();fn5();fn5();fn5();fn5();fn5();fn5();
  • test6

     
    fn6();fn6();fn6();fn6();fn6();fn6();fn6();fn6();fn6();fn6();
  • test7

     
    fn7();fn7();fn7();fn7();fn7();fn7();fn7();fn7();fn7();fn7();
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    test1
    test2
    test3
    test4
    test5
    test6
    test7

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0
Chrome 133 on Windows
View result in a separate tab
Test name Executions per second
test1 11284150.0 Ops/sec
test2 399979.7 Ops/sec
test3 36674316.0 Ops/sec
test4 1409040.4 Ops/sec
test5 50850840.0 Ops/sec
test6 4118291.5 Ops/sec
test7 465188.4 Ops/sec