A very interesting slide deck comparing sync and async IO

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Fri Mar 4 14:22:48 PST 2016


On Friday, 4 March 2016 at 03:14:01 UTC, Ali Çehreli wrote:.
> And that's exactly one of the benefits of fibers: two workers 
> ping pong back and forth, without much risk of losing their 
> cached data.
>
> Is my assumption correct?

Not if it is hyper-threaded, as pairs of threads are sharing 
resources. The only advantage of fibers is modelling, not 
performance. If you want max performance you need more control. 
But typical real world applications are far away from max 
theoretical performance, so maybe the impact isn't as great in a 
specific application for a given suboptimal pattern.

I don't think you can measure or benchmark whether you are doing 
objectively well or not, in an absolute sense. For that you need 
to calculate the theoretical throughput and then see how far away 
you are in the real world and explain why.

Otherwise you are just benchmarking a suboptimal pattern. Which 
makes sense when optimizing an existing application, but makes 
less sense when designing a new database engine from scratch.



More information about the Digitalmars-d mailing list