Boost logo

Boost Users :

Subject: Re: [Boost-users] boost asio synchronous vs asynchronous operations performance
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2014-03-30 10:13:11


On 30 Mar 2014 at 14:00, Bjorn Reese wrote:

> > Out of curiosity, how many CPU cycles per op in your ASIO test case?
> > AFIO seems to need ~9,000 CPU cycles per op processed, half of which
> > is spent spinning on CAS locks - I would assume that ASIO can knock
> > that down by two thirds?
>
> 1000 cycles/op -- measured via io_service::do_run_once().

Just to clarify, my ~9000 cycles/op is for maximum contention i.e.
fully loaded with eight threads all fighting it out. Is your 1000
cycles/op for two threads only?

Methinks AFIO could do with some minimum latency benchmarks actually
... might as well, I already have build time benchmarks.

> It locks/unlocks four times per operation, which accounts for a
total
> of 20% of the CPU time.

I'm actually surprised it's as much as that. I would have thought
twice per operation is the minimum possible, but you have to make
some hard design choices to get it that low. AFIO "looks funny"
partially because it locks exactly twice per op as from the v1.2
engine, unless you have TSX in which case it never locks at all
except if more memory from the kernel is needed.

Niall

-- 
Currently unemployed and looking for work in Ireland.
Work Portfolio: http://careers.stackoverflow.com/nialldouglas/



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net