Boost logo

Boost :

Subject: Re: [boost] [variant] address of a variant type from the address ofitssub-object?
From: Chris Glover (c.d.glover_at_[hidden])
Date: 2016-04-14 11:14:59


>
>
> That's hard to believe. Copying a pointer should be insignificant compared
> to the cost of the dispatch. What does the profiler say?
>

Which compiler? I have found that MSVC is extremely pessimistic with this
type of situation and generates unnecessary mov instructions for the
pointer in the struct. You can confirm it, if your case is simple enough,
by stepping through an inner loop to see if it's reloading that pointer
over and over again, even though there are no instructions changing the
pointer in that inner loop.

-- chris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk