3 ms·
thanks for this insight, I've countered the problem with command line args. Now the C compiler can't guess how many loops will be made and therefore the test sh
by karlheinz_py 11y ago
thanks for this insight, I've countered the problem with command line args. Now the C compiler can't guess how many loops will be made and therefore the test shows the same speed as C without using optimisation. But Go keeps having consistent speed, faster than C. I'm curious what kind of optimisation the Go compiler applies. See the update for further details..
- karlheinz_py 11y agoEdit: I thought C optimisation wasn't working but I repeated the tests and now C keeps having the same speed with optimisation despite passing the number as command line argument. This also suggests that the value is not calculated at compile time..