freeze vs seal vs normal (v9)

Revision 9 of this benchmark created on


Preparation HTML

<script>
  var o = {
    i: 42,
    s: 3,
    n: 5,
    r: 7,
    a: [1,2,3],
    f: function(i) { return i; }
  };
  var f = {
    i: 42,
    s: 3,
    n: 5,
    r: 7,
    a: [1,2,3],
    f: function(i) { return i; }
  };
  var s = {
    i: 42,
    s: 3,
    n: 5,
    r: 7,
    a: [1,2,3],
    f: function(i) { return i; }
  };
  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;
s.f(p);
ready
normal
var r = o.i + o.s + o.n + o.r;
o.f(r);
ready

Revisions

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