freeze vs seal vs normal (v17)

Revision 17 of this benchmark created by dan on


Preparation HTML

<script>
  var o = {
    i: 42,
    s: "someString",
    n: null,
    r: /ocd/,
    a: [1,2,3]
  };
  
  var seal = Object.seal(o);
  
  var frozen = Object.freeze(o);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
seal
var p = seal.i + seal.s + seal.n + seal.r;
ready
frozen
var q = frozen.i + frozen.s + frozen.n + frozen.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.