Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Fun fact: we've a system where Rust is faster than C despite still using more instructions

I think Bryan Cantrill did a pretty good explanation on differences you might see when rewriting something in Rust[1], and one of the things he looked at to see what was going on was Cycles Per Instruction. Instruction count itself means little if the instructions themselves have very different performance profiles and require different amounts of cycles to complete.

Edit: You are tracking and reporting that, so it's not like I'm telling you anything you don't know. I still think the included article is well worth reading though.

1: http://dtrace.org/blogs/bmc/2018/09/28/the-relative-performa...



Not only that, but your tight loop that takes up most of the execution time might have fewer instructions, whereas the rest of the program might have more, making the overall total higher but "instructions per time spent in function" lower.


Thanks for sharing this, I haven't seen this video before but it i mind blowing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: