Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7983145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:52:28+00:00 2026-06-04T10:52:28+00:00

Check out this test: http://jsperf.com/delegate-on-vs-bind-5 What I did was delegate the child with a

  • 0

Check out this test:

http://jsperf.com/delegate-on-vs-bind-5

What I did was delegate the child with a given parent and delegate another event to the child directly. Testing (at least in Chrome) seems to indicate that the delegating method is significantly faster than the direct binding method. This really goes against everything I’ve read about jQuery and also what I believe to be its intent. Is my test mistaken or should we really just be using the delegation method? Note that the parent is not even that close of an ancestor to the child.

This fiddle also confirms that the events are appropriately triggered with this DOM and JS:

http://jsfiddle.net/WtnRF/

Thoughts?

EDIT: To clarify, my specific question is why is the delegation method (traditionally supposed to be slower) so much faster than the bind method (supposed to be faster) in this test?

  • Did I just write a bad test?
  • Is jsperf benchmarking screwed up?
  • Should we really just be using the delegation method all the time since it’s superior?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:52:30+00:00Added an answer on June 4, 2026 at 10:52 am

    Real answers will follow I’m sure, but you asked for thoughts.

    My thought is that with modern systems it is Virtually Impossible to consistantly predict how a given construct will effect performance.

    You will get the explanation for this one, and after thinking about it for a while and fiddling with it you will believe it (Or maybe it will be found to be a measuring error), but in the long run it won’t give you any real insight into how to code better. Furthermore on a different browser/platform/version/day of the week it will happen to work differently.

    The problem is that if there is a construct they expect you to use a lot (because that’s how people generally code), they will optimize it first and it will probably perform faster. The results of this is that the performance improvements done at the levels beneath your code will typically improve your well-written code over code your hand-optimized code.

    This means you should NEVER code for performance, code for clarity and DRY, period. If you do so and hit a barrier where some customer or manager judges it too slow (Get Performance Requirements!), then consider recoding it with before-and-after measurements on each platform of course. Do comparisions and ensure that the “Optimized” solution is actually worth the lack of clarity and actually meets the requiremetns. Document WHY you did this in the code so someone else doesn’t come along and fix what looks like your crappy coding style later.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This will blow your mind... Check out http://blue-anvil.com/jquerycurvycorners/test.html using IE Curved corners look nice
Check out my example here: http://timkjaerlange.com/foobar/test.html I'm currently trying to apply a class to
check this out: template <class T> class Test: public T { public: void TestFunc()
I have made this webpage, you can check it out here http://www.bettingtowin.net/webcam.html I have
Check out this jsbin . I have a form with a custom button that
Check out this demo by FaTaL. It is explained in his blog that he
Check out this piece of JavaScript code: (function (w, d) { var loader =
This might be a very simple thing. Check out the normal sql query below
I used this script to create a jQuery accordion. Check out the working jsFiddle
Has anyone had this unusual(recurring) experience before? I'm trying to check out the project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.