4 ms·
Rust ran the loop at compile time.
by compressedgas 4y ago
Rust ran the loop at compile time.
- lowcoderev 4y agoIs that a feature specific to Rust? Can you please share any references to their official docs citing this?
- throwawaylinux 4y agoIt's a feature of optimizing compilers for decades. OP just didn't compile the C++ code with optimizations enabled.
- anandnair 4y agoEnabled compiler optimization for g++ and then the execution time went down to 0.00025, which made it slightly faster than Rust :)