POV-Ray : Newsgroups : povray.off-topic : Time is not free : Re: Time is not free Server Time
3 Sep 2024 21:13:07 EDT (-0400)
  Re: Time is not free  
From: Darren New
Date: 11 Nov 2010 15:38:38
Message: <4cdc544e$1@news.povray.org>
Warp wrote:
>   It would be less efficient because it would require always deep-copying
> data when it's passed around?

Basically. Deep-copying and duplicating.

If I say
   X is a list [1, 2, 3]
   Y is a list prepending 0 to X
   Z is a list prepending 9 to X
then X is still out there only once, and Y and Z point to it. Lists are 
"linked lists" rather than array-like lists.

>> The real situation is of course a bit more complicated than this, but 
>> you get the idea.
> 
>   It looks like a really inefficient way of computing a simple calculation.

It's a lazy calculation. Hopefully the compiler can figure out when it 
doesn't actually need to do that.

-- 
Darren New, San Diego CA, USA (PST)
   Serving Suggestion:
     "Don't serve this any more. It's awful."


Post a reply to this message

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