4 ms·
Yes, I constantly use this pattern in C++/JavaScript, although I haven't tested how performant it is in the former (what does the compiler even do with such an
by charleszw 10mo ago
Yes, I constantly use this pattern in C++/JavaScript, although I haven't tested how performant it is in the former (what does the compiler even do with such an expression?)
- paavohtl 10mo agoAt least in simple cases the compiler will just inline the closure, as if it never existed. There shouldn't be any measurable overhead.