4 ms·
This makes assumptions about what the performance requirements are. In latency sensitive code, _all_ code needs to be optimized. It doesn't matter if your slow
by dahfizz 3y ago
This makes assumptions about what the performance requirements are.
In latency sensitive code, _all_ code needs to be optimized. It doesn't matter if your slow function is only called once - it adds N microseconds of latency when it doesn't need to.
- preseinger 3y agooptimizations always have to be data-driven, from profiles, starting at the slowest stuff and working your way down, until you satisfy your latency requirements unless your slow function materially impacts your performance metrics in a way that you can reproducibly demonstrate, it's a mistake to optimize that code to shave off a few microseconds
- __d 3y agoIf there's a choice of spending X hours on performance tuning, fix the thing which gives the biggest win. There's no sense spending time saving 3us when you could have saved 3ms. And sure, once that's done, you can keep going to picoseconds, but there's only a limited number of application areas where that makes economic sense. It's also important to consider the entire system: you can optimize your code to the picosecond level, occupying the time of expensive engineers for months, but perhaps that $500k is better deployed on a PCIe5 bus, or a better Ethernet card, or a kernel-bypass stack, or even shorter network cables (every 300mm is a nanosecond, after all).