Documentation
Documentation
Posted Mar 19, 2022 13:05 UTC (Sat) by tialaramex (subscriber, #21167)In reply to: Great article! by dottedmag
Parent article: Donenfeld: Random number generator enhancements for Linux 5.17 and 5.18
Modern optimising compilers can assist greatly here by allowing us to more often express what we actually meant, rather than focusing on what code will deliver the best performance. And languages can help too, this is one of the opportunities for Rust once that's an option.
C doesn't even have iterators, you can't express "are all the doodads in this bag of doodads sparkly?" except by explicitly enumerating them, checking if they're sparkly and then discarding the enumeration, the reader must either imagine you actually wanted the enumeration (you didn't) or notice that you only use it as a way to iterate through the doodads and discard it once you determine if they're all sparkly. If you have a mix of any, all and none predicates to evaluate, the shortcuts needed to correctly provide good performance are different on each and a reader must discern what's going on there or the resulting loops are distracting because they're each different.
