|
|
|
|
|
by oriolid
1090 days ago
|
|
So, I had to try this. And look what happened on a 2015 Macbook running Monterey (edit: but check the thread below for possible explanation): ojs@MacBook-Pro-4 /tmp % time ./a.out
Hello world
./a.out 0.00s user 0.00s system 1% cpu 0.268 total
ojs@MacBook-Pro-4 /tmp % time ./a.out
Hello world
./a.out 0.00s user 0.00s system 72% cpu 0.004 total
It's really that slow on first try. The binary was compiled just before running it, and it's the simplest possible hello world using C++ std::cout, compiled with -O3. C version with puts behaves just the same. |
|
The difference you show depends on the internet connection, on slow wifi I've seen this delay go over 0.7s in the past. But again, just the first time, which is a problem for developers who recompile their code frequently but for the end user experience that's not as relevant.