Question

I was just browsing the endless list of jsperf tests and looked at the one called == vs === perf. I expected the outcome to be a no-brainer ( === to be faster ) but no, not in FireFox.

Can someone explain to me how Firefox can be so fast and how it is possible that === is more or less equal to == ?

Although this post has a lot in common with my post, it doesn't answer the result Firefox produces!

Was it helpful?

Solution

== vs. === is not going to make a real-world difference in your code’s performance. This is a microbenchmark.

Check out this presentation by @mraleph, explaining why microbenchmarks are evil and should be avoided: https://www.youtube.com/watch?v=65-RbBwZQdU&hd=1 He explains why tests like the one you linked to are basically useless, as engines optimize things like this away.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top