
On 25 May 2011 11:11, Phil Bouchard <philippe@fornux.com> 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@eviloverlord.com> (847) 691-1404