Hacker News new | past | comments | ask | show | jobs | submit login

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`




The "took #ms" line is output of the program. It does not include compilation time.


The 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.


This 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/ray...




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

Search: