Hacker News new | ask | show | jobs
by rzezeski 4296 days ago
Author here, I won't get to it today but I would like to try the method you describe. I realize that benchmarking is a very tricky thing having followed Brendan Gregg's work the last couple of years. This is why I also ran my baseline benchmark which simply performed a ret. I learned years ago from tuning cars that absolute numbers are less interesting than relative. That said, I am a total newb at low-level stuff like this and I would not be surprised if I messed something up. I'll be curious to use your method and see how it compares.
1 comments

Great short intro! One other useful thing I'd add is that you don't have to have the register window open to see the contents of registers --- they can also be printed like other variables while you are in 'layout asm'. Or you can use 'layout split' which shows both source and assembly.

For example, "p/t $rax" will print the contents of %rax. Printing the floating point registers can be a little awkward, since they are written as a long union. But "p/f $xmm0.v2_double" will show just the two doubles, etc.

One thing I like about the register view is the highlighting on register change.

This is great when an instruction changes a register beyond a basic MOV/ADD/SUB.

Using register view ended up being the "lightbulb" moment which helped me understand how stack frames are built.