4 ms·
I think that the compilation flags utilized are needed in order to properly justify the validity of the microbenchmark here. At opt-level 2 and 3 rust complete
by cbondurant 1y ago
I think that the compilation flags utilized are needed in order to properly justify the validity of the microbenchmark here.
At opt-level 2 and 3 rust completely optimizes away the interior loop, leaving just two instructions (plus a check for if n=0). given that your graph isnt showing O(1) time complexity shows you either
1) didn't compile your rust code in release mode for benchmarking, as the release profile uses opt-level=3
or
2) intentionally downgraded the opt-level of the release profile in order to run these tests
I'd be interested to see a more proper example, one where the task itself has some non-zero time complexity. Show a quicksort implementation perhaps. But as it stands this is just marketing smoke and mirrors.
- olokobayusuf 1y agoWay ahead of you: https://github.com/olokobayusuf/python-vs-rust/blob/main/Cargo.toml#L13 https://github.com/olokobayusuf/python-vs-rust/blob/main/Car... I've clarified that this is not designed to be a rigorous benchmark. We've got rigorous benchmarks coming for image processing and CNN inference. I'll reply with the image processing example benchmark this week.