POV-Ray : Newsgroups : povray.off-topic : Speed comparison between C# and C++ : Re: Speed comparison between C# and C++ Server Time
1 Oct 2024 07:24:05 EDT (-0400)
  Re: Speed comparison between C# and C++  
From: Darren New
Date: 17 Apr 2008 13:22:44
Message: <48078764$1@news.povray.org>
Nicolas Alvarez wrote:

>> Warp wrote:
>>>   It's certainly not a good idea to create, resize and destroy 6 vectors
>>> at each iteration.
>>
>> And in a well-tuned GC system, that's less of a problem, see? :-)
> 
> Somebody uses a C++ feature inefficiently, and that proves GC is better??

You're taking a hopefully-educational comment and turning it into a C++ 
bash yourself there. "Allocating everything on the heap is often more 
efficient in a well-tuned GC than allocating everything on the heap when 
you're doing manual memory management" is not a bash on manual memory 
management.  *I* didn't even *mention* C++ in that sentence.

>> That's part of the reason these languages *do* allocate everything on
>> the heap - it's not as much of a problem. Honestly, I'm not 100% sure
>> why, but when folks actually measure, it often works out that way.
> 
> A C++ vector is not kept in the stack. Well, the vector itself is 
> (bookkeeping info) but the data inside is heap-allocated by the vector 
> AFAIK.

I wonder if maybe it's a locality-of-reference thing then. :-)


-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.