Oh, my GoD! Goroutines on D

mw mingwu at gmail.com
Sun Jun 14 16:57:55 UTC 2020


On Sunday, 14 June 2020 at 14:24:29 UTC, Jin wrote:
> On Monday, 25 May 2020 at 16:26:31 UTC, Jin wrote:
>> On Saturday, 16 May 2020 at 20:06:47 UTC, mw wrote:
>>> On Tuesday, 29 March 2016 at 17:10:02 UTC, Jin wrote:
>>>>
>>>> http://wiki.dlang.org/Go_to_D
>>>
>>> Any performance comparison with Go? esp. in real word 
>>> scenario?

...

>> I have updated the code. But it isn't ready to use currently 
>> because:
>>
>> 1. I rewrote code to use std.parallelism instead of vibe.d. 
>> So, it's difficult to integrate fibers with tasks. Now, every 
>> tasks spinlocks on waiting channel and main thread don't 
>> useful work.
>>
>> 2. Race condition. I'm going to closely review algorithm.
>>
>> Currently it's twice slower than Go. On y machine:

...

> I have fixed all issues, and it's usable now. But I had to 
> return vibe-core dependency. Now it's slow down:
>
>> .\compare.cmd
>>go run app.go --release
> Workers Result          Time
> 4       4999500000      25.9163ms
>>dub --quiet --build=release
> Workers Result          Time
> 4       4999500000      116 ms
>
> And I had to reduce the count of "threads" to 100 because 
> vibe-core fails on 1000.
>
> And I have created thread on dlang/project with an explanation 
> of my vision of concurrency in D: 
> https://github.com/dlang/projects/issues/65

I haven’t checked your implementation, or vibe’s, but I 
rediscovered that D’s message passage passing is ~4 times slower 
than Java:

https://forum.dlang.org/thread/mailman.148.1328778563.20196.digitalmars-d@puremagic.com?page=4

Is this the same problem in GoD?








More information about the Digitalmars-d mailing list