On Thu, 08/16 00:29, Emilio G. Cota wrote:
> On Wed, Aug 15, 2018 at 19:55:14 -0400, Emilio G. Cota wrote:
> > On Wed, Aug 15, 2018 at 00:53:23 -0400, Emilio G. Cota wrote:
> > > On Wed, Aug 15, 2018 at 11:09:42 +0800, Fam Zheng wrote:
> > > > On Mon, 08/13 13:11, Emilio G. Cota wrote:
> > > > > +  --enable-sync-profiler) sync_profiler="yes"
> > > > > +  ;;
> > > > 
> > > > Curious, not asking for a change: can this be made a runtime option 
> > > > instead of
> > > > compile time, since there's no library dependencies? That should make 
> > > > this
> > > > somewhat easier to use.
> > > 
> > > Good point. I'll do some profiling tomorrow to see how the latency
> > > of the locking primitives could be minimized (ideally, not using
> > > the profiler should just add a well-predicted branch).
> > 
> > I reduced it to just a branch, but still, I measured a few percentage
> > points (1-2%, depending on the machine) slowdown when this is a
> > run-time option. (This is for a bootup+shutdown test of a guest.)
> > 
> > So I'll keep it as a build-time option, then.
> 
> I looked further into this. Turns out we don't need the branch at all;
> we can make indirect calls via function pointers, where the
> pointers are set by qsp_enable/disable().
> 
> Overhead of doing things this way is within noise range, since
> compilers and CPUs are so good at dealing with indirect calls.

Very nice finding! Thanks.

Fam

> 
> I'll send a v2 tomorrow.
> 
>               Emilio

Reply via email to