POV-Ray : Newsgroups : povray.off-topic : Speed comparison between C# and C++ : Re: Speed comparison between C# and C++ Server Time
4 Nov 2024 13:13:58 EST (-0500)
  Re: Speed comparison between C# and C++  
From: Darren New
Date: 17 Apr 2008 12:39:45
Message: <48077d51$1@news.povray.org>
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? :-) 
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.

C# has value types too. I wonder how much you'd speed it up by not 
heap-allocating vectors to start with in C#.

Maybe the C# over-allocates the vectors, so the resize is cheap, and the 
C++ vectors have to actually get moved when resized?

Just random thoughts on the topic.

-- 
   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.