News for hackers. Stuff that matters.
Re:How JavaScript works: inside the V8 engine by avaer on Monday August 21, 2017 @10:34PM (#15069302)
If you call a function with a different number or type of arguments, or an object that has different keys, or even keys that you added in a different order, bets are off and the optimizer might not be able to reuse previously optimized versions of the function. And if you do this several times, the engine might give up optimizing your function entirely.
Re:How JavaScript works: inside the V8 engine by Groxx on Monday August 21, 2017 @10:40PM (#15069328)
Worth noting that this is valid advice for nearly everything with a JIT (and many languages with generics without a JIT, since doing so likely bloats your dispatch logic, whether it's dynamic or built at compile-time).