Map vs $.each (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var data = {
      test: "test1",
      test1: "test2",
      test2: "test3"
    };

Test runner

Ready to run.

Testing in
TestOps/sec
Map
var arr = data.map(function(item) {
  return JSON.stringify(item);
});
ready
$.each
$.each(data, function(key, value) {
  data[key] = JSON.stringify(value);
});
ready

Revisions

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