News for hackers. Stuff that matters.
Re:Lessons learned from profiling an algorithm in Rust by pcwalton on Sunday October 13, 2024 @03:15PM (#41830704)
I'm guessing that f32::clone showing up in the profile isn't actually a call to f32::clone, because you have optimizations on (if it actually is a call to a "movd xmm0,dword ptr [rdi]; ret" instruction pair, that's a bug in the compiler). Rather it's the result of the compiler choosing to attribute seemingly-random lines to f32::clone, because when lines from multiple functions are fused into one instruction the compiler will just pick one, and it happened to pick f32::clone to write into the debug info. You really want to look at instruction-level profiling when you're profiling at that level instead of the individual functions, since debug info is going to be very unreliable.
Re:Lessons learned from profiling an algorithm in Rust by eftychis on Sunday October 13, 2024 @05:12PM (#41831647)
Seconded. This could have been essentially anything and everything else bunched together. Or we have a compiler or debug symbol bug in our hands.
Re:Lessons learned from profiling an algorithm in Rust by urcyanide on Sunday October 13, 2024 @07:41PM (#41832729)
I also see the profiling shows that the "iter::next" takes a large percentage in the flamegraph. Are they the same reason?