4 ms·
I copy/pasted the code in the article and compiled each one. I am getting very different ratios compared to the ones you posted: tmp$cc -Wall -O2 test.c -o tes
by halayli 12y ago
I copy/pasted the code in the article and compiled each one. I am getting very different ratios compared to the ones you posted:
tmp$cc -Wall -O2 test.c -o test && time ./test
real 0m1.041s
user 0m0.998s
sys 0m0.029s
nim-0.10.2$./bin/nim --opt:speed c test.nim && time ./test
real 0m1.943s
user 0m1.894s
sys 0m0.036s
- dom96 12y agoTry compiling with -d:release instead of --opt:speed.
- deleted 12y ago[deleted]
- def- 12y ago$ gcc -O2 -std=c99 -lm -o c c.c $ time ./c ./c 2.49s user 0.07s system 99% cpu 2.567 total $ nim -d:release c nim $ time ./nim ./nim 2.47s user 0.07s system 99% cpu 2.538 total Yes, --opt:speed is slower indeed: $ nim --opt:speed c nim $ time ./nim ./nim 3.02s user 0.07s system 99% cpu 3.095 total
- halayli 12y agoAh -d:release made the results almost identical. Thanks!