News for hackers. Stuff that matters.
Re:Get rid of those boolean function parameters (2015) by kevincox on Monday September 20, 2021 @12:06PM (#28595328)
In theory yes. But for hot inner loops you will probably get it optimized away. (This is a common pattern so optimizer try to find it and undo it. Furthermore hidden classes for objects are common and when you destructure directly in the argument list escape analysis is pretty easy) It probably does hurt your performance for warm and cold code but that likely isn't too significant.

So yes, if performance is critical you should probably profile and consider avoiding this pattern, but for most cases the performance impact is very minor.

There are no comments on this comment yet.