3 ms·
When you do `go run qsort.go` you are also timing the time taken by Golang to build/compile the code. I suspect the same applies to `cargo run` You should do
by komuW 5y ago
When you do `go run qsort.go` you are also timing the time taken by Golang to build/compile the code.
I suspect the same applies to `cargo run`
You should do something like; `go build . && time ./qsort`
- masklinn 5y agoThe same occurs with Rust, we can even see that the no-op recompilation takes about 20ms. It’s obviously just a rough estimate / comparison otherwise it’d be using hyperfine or something along those lines.
- nessex 5y agoThis is not the case, it measures the time between two points in the code at runtime and prints that[1]. [1] https://github.com/kprotty/zap/blob/blog/benchmarks/rust/rayon_qsort.rs#L14-L17 https://github.com/kprotty/zap/blob/blog/benchmarks/rust/ray...
- Arnavion 5y agoThe "took #ms" line is output of the program. It does not include compilation time.