--- Log opened Mon Jan 15 00:00:30 2024 00:27 -!- salvatoshi [~salvatosh@genymobile-2-6-86.fib.nerim.net] has joined #bitcoin-rust 04:49 -!- Guest62 [~Guest62@103.171.98.62] has joined #bitcoin-rust 04:49 -!- Guest62 [~Guest62@103.171.98.62] has quit [Client Quit] 05:34 < yancy> Ademan_ I don't think I follow. If checked_add() isn't used then the code will panic on overflow. Using checked_add will return None instead of panic. 05:35 < yancy> Also, underflow doesn't apply here since we are taking about Amount which isn't a float 05:41 < yancy> anyway, if you can be sure the code will not overflow, then it should be possible to use a none checked version if performance is a consideration I would think. 05:41 < yancy> s/none/non 05:43 < yancy> or even if you're not sure it woun't overflow but prefer a program panic to a Option type return, then it should be possible 05:44 < yancy> s/a/an 05:58 -!- Ademan [~ademan@47.185.95.178] has joined #bitcoin-rust 07:22 < andytoshi> yancy: your Amount test has parsing in it while your u64 test does not, which is skewing your benchmarks 07:24 < andytoshi> if it were due to differences because of teh extra branch, i'd expect u64 to be much more than twice as fast, because the compiler should be able to entirely optimize a "add 1 repeatedly a fixed number of times" away to a computation of (n)(n+1)/2, which it should be able to optimize away as a fixed constant 07:24 < andytoshi> all this to say that i'm doubtful that your u64 loop is doing anything at all, without sticking some black_box calls somewhere 07:25 < andytoshi> i suspect actually that neither addition loop is doing anything, and you're purely testing "calling a function" vs "calling a function that parses a string" 09:08 -!- salvatoshi [~salvatosh@genymobile-2-6-86.fib.nerim.net] has quit [Ping timeout: 256 seconds] 12:00 -!- salvatoshi [~salvatosh@lfbn-idf3-1-1331-187.w92-170.abo.wanadoo.fr] has joined #bitcoin-rust 14:21 -!- unknown_unknown6 [~unknown_u@169.150.219.145] has quit [Quit: Ping timeout (120 seconds)] 14:21 -!- unknown_unknown6 [~unknown_u@169.150.219.145] has joined #bitcoin-rust 14:22 -!- achow101 [~achow101@user/achow101] has quit [Remote host closed the connection] 14:23 -!- achow101 [~achow101@user/achow101] has joined #bitcoin-rust 14:52 -!- DeanGuss [~dean@user/deanguss] has quit [Ping timeout: 264 seconds] 14:57 -!- DeanGuss [~dean@nonplayercharacter.me] has joined #bitcoin-rust 14:57 -!- DeanGuss [~dean@user/deanguss] has changed host 15:03 -!- Netsplit *.net <-> *.split quits: tnull[m], wpaulino, ademan[m], BlueMattMtrxBot, Guest7282, BlueMatt[m], appservicebot123, BlueMatt 15:04 -!- Netsplit over, joins: appservicebot123, Guest7282, tnull[m], wpaulino, BlueMatt[m], ademan[m], BlueMattMtrxBot, BlueMatt 15:09 < yancy> I think you're right that neither loop is doing anything. The parsing isn't happening in the loop, so I didn't suspect that would make a difference, and the functions have areturn value, so I was thinking the compiler wouldn't optimize the return results. Adding some params and wrapping in black_box has similar results. Without looking at the assembly it's hard to now what's being timed. 16:05 -!- salvatoshi [~salvatosh@lfbn-idf3-1-1331-187.w92-170.abo.wanadoo.fr] has quit [Ping timeout: 256 seconds] 20:56 -!- Ademan [~ademan@47.185.95.178] has quit [Quit: leaving] 23:45 -!- Guest7282 [~Guest7282@1.195-178-91.adsl-dyn.isp.belgacom.be] has left #bitcoin-rust [Error from remote client] 23:58 -!- salvatoshi [~salvatosh@genymobile-2-6-86.fib.nerim.net] has joined #bitcoin-rust --- Log closed Tue Jan 16 00:00:33 2024