0

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!

0

1 Answer 1

3

== 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.