문제

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!

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top