> The code is not making a reasonable comparison because it creates N 
goroutines. It should create only GOMAXPROCS goroutines and use no channels 
and use no WaitGroup. Then it would be roughly equal to what .net does.
> But we are already far away from what was my point. Nevermind ;-)

I've tried to get close to it with version "channel per result", see my 
message above.
And we are measuring typical way to do coding. Only few people in a world 
will copy same internal construction .Net uses.

Fixed code for .Net, so it uses more CPU cores.
Now it uses more CPU, and Go version "channel per result" now looks not bad 
compared to.
New results:

headon/parallelism/dotnet$ /usr/bin/time dotnet run -c Release 10000
Project dotnet (.NETCoreApp,Version=v1.0) was previously compiled. Skipping 
compilation.
Task to execute: 10000
10000 in 00:00:00.0216859, hash = 0xb64c05b4
0.67user 0.05system 0:00.58elapsed 124%CPU (0avgtext+0avgdata 
65364maxresident)k
0inputs+48outputs (0major+18283minor)pagefaults 0swaps
headon/parallelism/dotnet$ /usr/bin/time dotnet run -c Release 100000
Project dotnet (.NETCoreApp,Version=v1.0) was previously compiled. Skipping 
compilation.
Task to execute: 100000
100000 in 00:00:00.1708238, hash = 0x829de33c
1.01user 0.09system 0:00.78elapsed 140%CPU (0avgtext+0avgdata 
66756maxresident)k
0inputs+48outputs (0major+26606minor)pagefaults 0swaps
parallelism/dotnet$ /usr/bin/time dotnet run -c Release 1000000
Project dotnet (.NETCoreApp,Version=v1.0) was previously compiled. Skipping 
compilation.
Task to execute: 1000000
1000000 in 00:00:01.6099377, hash = 0xde68528c
4.46user 0.19system 0:02.17elapsed 214%CPU (0avgtext+0avgdata 
128232maxresident)k
0inputs+48outputs (0major+61664minor)pagefaults 0swaps

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to