closure vs bind query

Benchmark created by muffin on


Setup

var closure = function(query, parent) {
                return (parent || document).querySelector(query);
    };
    
    var bind = document.querySelector.bind(document);

Test runner

Ready to run.

Testing in
TestOps/sec
closure
closure("body div")
ready
bind
bind("body div")
ready
inline
document.querySelector("body div")
ready

Revisions

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

  • Revision 1: published by muffin on