Live data from Hacker News

Always return on events is faster, but why?

jsperf.com

51–52 of 52 posts

Re: Always return on events is faster, but why?

#51

Earlier quoted context omitted.

eulerphi: FYI you're hellbanned

Uh... What happened? Just realized my comment wasn't 100% accurate (it's multiple event listeners rather than unsettled event) but... ?

Sorry for the hijacking.

Someone named eulerphi replied to your comment, but they're "hellbanned" from Hacker News and their reply is only visible if you turn on showdead in your settings.

Re: Always return on events is faster, but why?

#52
post #45

Earlier quoted context omitted.

Well, before the GP post, my takeaway was that it's better to return when using jQuery . The justification for this would have been some magic, which is the sole purpose of jQuery, slowing stuff down. And the web being as it is, testing with jQuery might even be more useful than testing without it.

That is a common fallacy and benchmarking anti-pattern, and it really enrages me that some people look at the completely incorrect results and justify it with "I am going to be using this with jQuery so why shouldn't I add some jQuery method calls". And you are denying this despite the "fixed" js perf showing different results e.g. on chrome 29. You should read http://zedshaw.com/essays/programmer_stats.html

I think you misunderstood. I'm denying nothing.

What I meant was that if I'm going to run a website with jQuery calls, I should absolutely test with jQuery calls. It makes no sense to claim that one should, say, always use short variable names, if one then ships with google closure.

Post reply on HN