Emptying an array - Trying to force GC (v23)

Revision 23 of this benchmark created by SunboX on


Setup

var arr = [];
  for(var i = 0, len = 25 * 1024 * 1024; i < len; i++) // runs 25 to 100 times = some mb
  {
      arr.push('a');
  }

Test runner

Ready to run.

Testing in
TestOps/sec
Setting .length to 0
arr.length = 0;
ready
Creating a new empty array
arr = [];
ready

Revisions

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