Subject: Re: [boost] [Block Pointer] benchmark
From: Nevin Liber (nevin_at_[hidden])
Date: 2011-05-25 15:18:31
On 25 May 2011 11:11, Phil Bouchard <philippe_at_[hidden]> wrote:
> On 5/25/2011 8:00 AM, Nevin Liber wrote:
>> And what exactly is make_auto doing that is *much more* costly than a heap
>> allocation? According to your numbers, it takes almost 2.5x longer than
>> just a new.
> The make factory functions create a temporary r-value which needs to be
> copied to the next l-value; this is why it is much slower.
Is it copying anything more than a pointer? Are you really asserting that
copying a pointer is far more work than a heap allocation?? Could you post
some assembly on any platform backing your assertion?
Just trying to understand, because to me, this seems totally absurd. You
can talk all you want about r-values and l-values causing some mysterious
slowdown, but at the end of the day, copying a pointer doesn't result in
more than a few machine instructions, even unoptimized.
-- Nevin ":-)" Liber <mailto:nevin_at_[hidden]> (847) 691-1404
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk