jQuery.fly() - flyweight pattern (v4)

Revision 4 of this benchmark created by Matjaž Lipuš on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://github.com/matjaz/jquery.fly/raw/master/jquery.fly.js"></script>

<script>
  var a = $('<div/>').append(Array(100).join('<a></a>')).find('a');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Iterate using jQuery object
a.each(function() {
 $(this);
});
ready
Iterate using jQuery.fly()
a.each(function() {
 $.fly(this);
});
ready

Revisions

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

  • Revision 2: published by Matjaž Lipuš on
  • Revision 3: published by Matjaž Lipuš on
  • Revision 4: published by Matjaž Lipuš on