--- Log opened Sun Jun 11 00:00:28 2023 03:48 < real_or_random> when I see code like this https://github.com/bitcoin-core/secp256k1/pull/1339 (both before and after), I wonder why usually don't have loops 03:58 < real_or_random> sipa: was this to help the compiler? But independently, is it even more readable? "Two or more, use a for" is the conventional wisdom here, and in general I believe code should be easy to change (ETC -- a term from The Pragmatic Programmer, but I'm not convinced that a loop is easier to change. It's harder to read even if it's fewer lines. 03:59 < real_or_random> Anyway, none of this really matter. I'm just contemplating about good programming. 06:38 < theStack> real_or_random: was wondering the same. i guess the motivation is primarily performance, as this seems to be a case of loop unrolling, i.e. wanting to avoid extra cycles and variables for loop control? 06:39 < theStack> (would be interesting if a modern compiler does the unrolling even if it's written as a loop) 06:41 < sipa> some probably will 06:56 -!- Guest49 [~Guest49@2607:fb90:806a:e54d:cc6d:b205:2f68:15f0] has joined #secp256k1 06:58 -!- Guest49 [~Guest49@2607:fb90:806a:e54d:cc6d:b205:2f68:15f0] has quit [Client Quit] 10:00 < real_or_random> to be honest, I also except compilers to roll this into a loop code if they think that's better 10:00 < real_or_random> (but I have no idea if they do this) 10:03 < real_or_random> hm, now I'm wondering if rolled code can actually be faster at all. it's certainly shorter. but perhaps that's not worth a complex optimization pass. ^^ whatever 13:23 < sipa> I suspect my intent was indeed to force unrolling; but agreed that it may be better to let the compiler decide. 16:40 -!- preimage [~halosghos@user/halosghost] has joined #secp256k1 18:11 -!- p2plife [~p2plife@vps-46773dd2.vps.ovh.net] has quit [Server closed connection] 18:12 -!- p2plife [~p2plife@vps-46773dd2.vps.ovh.net] has joined #secp256k1 21:27 -!- preimage [~halosghos@user/halosghost] has quit [Quit: WeeChat 3.8] --- Log closed Mon Jun 12 00:00:28 2023