On Fri, Aug 4, 2017 at 9:51 AM, Henrik Johansson <dahankz...@gmail.com> wrote:
> Actually I get the same as the original program on my mac. > > time ./ccode > sum=606329794183272.375000 > ./ccode 0.17s user 0.00s system 98% cpu 0.170 total > > The Go version -O2 -Wall > time ./pow > sum=6.063297941832724e+14./pow 5.47s user 0.01s system 99% cpu 5.490 total > interesting :) I have: $> gcc --version gcc (GCC) 7.1.1 20170630 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. also interestingly, with clang: $> clang --version clang version 4.0.1 (tags/RELEASE_401/final) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/bin $> time ./c-code real 0m0.001s user 0m0.001s sys 0m0.000s $> time ./c-code-sum sum=606329794183272.375000 real 0m0.228s user 0m0.227s sys 0m0.000s I haven't looked at the assembly to see what's really going on for the GCC version... -s -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.