2 ms·
QuerySelectors are slow. Epic slow. I would also argue that querySelectors are far less flexible and became popular because they are instead easy. https://jsbe
by throwaway0asd 4y ago
QuerySelectors are slow. Epic slow. I would also argue that querySelectors are far less flexible and became popular because they are instead easy.
https://jsbench.github.io/#b39045cacae8d8c4a3ec044e538533dc https://jsbench.github.io/#b39045cacae8d8c4a3ec044e538533dc
ProTip: Without numbers performance opinions are wrong by several orders of magnitude 80% of the time.
- wruza 4y agoI’m getting 70mops byId and 23mops qs-#id. This looks like making a huge difference until I add these cases: 3: "abc”.replace("a", "b") 4: "1" * 2 Which result in 15mops and 74mops respectively. This test measures diameters of neutrinos so to say.
- throwaway0asd 4y agoMy experience is that most developers tend to guess at performance and throw away numbers they disagree with. As a result performance testing is only something product owners care about.