this.$('selector') vs this.$el.find('selector') in backbone (v6)

Revision 6 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.0/backbone-min.js"></script>

<div id="something"><div class="inner"></div></div>

Setup

var View = Backbone.View.extend({
      el: '#something'
    });
    var v = new View();

Test runner

Ready to run.

Testing in
TestOps/sec
this.$
v.$('.inner');
ready
this.$el.find
v.$el.find('.inner');
ready

Revisions

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