@josh dev was doing some premature optimization, which i personally think is great fun, but it was not a good use of their time
Conversation
Notices
-
Embed this notice
Ryan Castellucci :nonbinary_flag: (ryanc@infosec.exchange)'s status on Saturday, 27-Jul-2024 08:38:43 JST Ryan Castellucci :nonbinary_flag: -
Embed this notice
Ryan Castellucci :nonbinary_flag: (ryanc@infosec.exchange)'s status on Saturday, 27-Jul-2024 08:42:30 JST Ryan Castellucci :nonbinary_flag: - hot path: code that runs a lot
- profiling: a process that figures out which code is taking up how much time when a program runs
- disassembled compiler output: the compiler turns code into cpu instructions - looking at this can give you some idea of how efficient the code is
- the compiler: best thought of as an evil genie you asked to make your code run fast
-
Embed this notice
Ryan Castellucci :nonbinary_flag: (ryanc@infosec.exchange)'s status on Saturday, 27-Jul-2024 08:47:45 JST Ryan Castellucci :nonbinary_flag: @josh A modern compiler can turn this:
uint32_t example() {
uint32_t val = 0, i = 0;
for (i = 0; i < 100; ++i) {
val = ((val + 1) * i) % 123456789;
}
return val;
}into essentially
uint32_t example() {
return 83339357;
} -
Embed this notice
Ryan Castellucci :nonbinary_flag: (ryanc@infosec.exchange)'s status on Saturday, 27-Jul-2024 10:34:49 JST Ryan Castellucci :nonbinary_flag: -
Embed this notice
sabik (sabik@rants.au)'s status on Saturday, 27-Jul-2024 10:34:50 JST sabik @ryanc @josh
Make the tiniest mistake, though, and the compiler will throw away the whole thingno error, no warning, if you try to use it, it'll just use a different one for you
-
Embed this notice