Oh, my GoD! Goroutines on D

Petar Petar
Tue Jun 16 07:24:41 UTC 2020


On Monday, 15 June 2020 at 22:04:49 UTC, mw wrote:
> On Monday, 15 June 2020 at 09:09:23 UTC, Jin wrote:
>> I have added a new release and a PR to your repo.
>
> on my same machine, go.d:
>
> received 100000000 messages in 2906 msec sum=4999999950000000 
> speed=34411 msg/msec
>
> so, it's ~2.7x faster than Java:
>
> https://github.com/mingwugmail/liblfdsd/tree/master/comparison
>
> And your https://github.com/nin-jin/go.d on my machine
>
> go.d is 2~4 times slower than Go.
>
> 9.7638ms (Go) v.s [19 ms ~ 40 ms] (go.d)
>
> Go's speed is consistent in multiple runs, for go.d it can be 
> 2x difference, maybe because of the scheduler is unstable?
>
>
>> But I don't think it's a good idea to replace jin.go.queue by 
>> lock_free.rwqueue because:
>
> I just want to do a comparison.
>
>> You are using atomicLoad!(MemoryOrder.acq) at there: 
>> https://github.com/MartinNowak/lock-free/blob/master/src/lock_free/rwqueue.d#L41
>> Is this really required? CPU can't reorder dependent 
>> statements.
>
> It's not mine, but @MartinNowak's.  The implementation is based 
> on
>
> https://www.codeproject.com/Articles/43510/Lock-Free-Single-Producer-Single-Consumer-Circular

There's a SPMC/MPSC queue implementation here: 
https://github.com/weka-io/mecca/blob/master/src/mecca/containers/otm_queue.d that may be also interesting for you guys to check.


More information about the Digitalmars-d mailing list