delete vs undefined vs null in large object

JavaScript performance comparison

Revision 78 of this test case created by

Preparation code

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js"></script>
<script>
  o = {
   k: {p: 1}
  };
  var id = 0
  
  function reset() {
   o.k.p = ++id;
  }
</script>
    

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
delete
var i;
for (i = 0; i < 1000000; i++) {
 delete o.k.p;
 reset();
};
pending…
unset
for (i = 0; i < 1000000; i++) {
 _.omit(o, 'k.p');
 reset();
};
pending…

Compare results of other browsers

Revisions

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

0 Comments