freeze vs seal vs normal (v18)

Revision 18 of this benchmark created by Joshua Wise on


Preparation HTML

<script>
  var o = {
    i: 42,
    s: 3,
    n: 5,
    r: 7,
    a: [1,2,3],
  };
  var f = {
    i: 42,
    s: 3,
    n: 5,
    r: 7,
    a: [1,2,3],
  };
  var s = {
    i: 42,
    s: 3,
    n: 5,
    r: 7,
    a: [1,2,3],
  };
  Object.seal(s);
  Object.freeze(f);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
seal
var p = s.i + s.s + s.n + s.r;
ready
frozen
var q = f.i + f.s + f.n + f.r;
ready
normal
var r = o.i + o.s + o.n + o.r;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.