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.