3 ms·
I don't think this translates to the real world- one of the main things they did for that benchmark is add a special case for $('body') which will probably slow
by gregwebs 17y ago
I don't think this translates to the real world- one of the main things they did for that benchmark is add a special case for $('body') which will probably slow down (not noticeably though) most people's code.
- jeresig 17y agoErm - how would it slow down people's code? We're already doing a check to see if a tag name is being used and optimize based upon that, we just added one additional check to optimize for body. There is absolutely no way in which the check: if ( selector === "body" && !context ) ... Will have performance implications in your application.
- gregwebs 17y agoPlease excuse my brevity- that is what I was trying to say with "(not noticeably)". Technically, or course it will slow down code not using the conditional.