News for hackers. Stuff that matters.
Re:Why You Should Always Use === and Other Bad Practices by inglor on Sunday February 09, 2014 @06:59PM (#7208115)
Not really, things like branch prediction and JIT optimizations will kick in pretty fast. This is why these benchmarks on jsperf suck - the code gets a different 'fresh' version every time and jits (like crankshaft in v8 ) don't get to work.

Effectively, you're checking 'the performance of interperted JavaScript' most the the time.

Re:Why You Should Always Use === and Other Bad Practices by goldenkey on Sunday February 09, 2014 @07:05PM (#7208148)
I bet my bottom dollar that branch prediction is not going to magic away that index dependent if statement in a language like JS, even with Crankshaft in full effect.
Re:Why You Should Always Use === and Other Bad Practices by inglor on Sunday February 09, 2014 @07:23PM (#7208240)
Here, it's within 20% of the performance. Definitely not n vs 2n http://jsperf.com/oh-look-branches
Re:Why You Should Always Use === and Other Bad Practices by mraleph on Monday February 10, 2014 @09:38AM (#7211255)
The actual percentage depends on the CPU. On mobile the cost would likely be higher (e.g. on my phone it's around 33%), on old CPU can be even higher, but people don't usually care about them these days.
Re:Why You Should Always Use === and Other Bad Practices by inglor on Monday February 10, 2014 @10:24AM (#7211501)
Hi! Hoped you liked the plugs here. Write more!