Re:Making a Go program 70% faster by avoiding common mistakes
by emehrkay on Thursday March 17, 2016 @09:59AM
(#11304342)
It's like seeing this in everyone's JavaScript
[ Parent
| on HN ]
Re:Making a Go program 70% faster by avoiding common mistakes
by Cthulhu_ on Thursday March 17, 2016 @11:32AM
(#11304957)
Isn't there a decent caching system behind that?
OTOH, .action() could change the whole dom so that .some_selector matches something else or nothing at all, so I guess jquery couldn't make that assumption / optimization without knowing what .action() does, or without doing a deep analysis of what DOM elements .action() altered and whether the selector on the next line is affected.
Re:Making a Go program 70% faster by avoiding common mistakes
by TheHegemon on Thursday March 17, 2016 @06:07PM
(#11308017)
Thank you! That is one of my greatest pet peeves.
Or needless selectors like $('div.some-div input.some-input') where the classes are never used on anything other than divs/inputs. Another thing I've seen: $('#someId #childId').