POV-Ray : Newsgroups : povray.general : CSDL alpha 3 released : Re: CSDL alpha 3 released Server Time
19 Nov 2024 09:40:22 EST (-0500)
  Re: CSDL alpha 3 released  
From: Christopher James Huff
Date: 25 Mar 2002 09:31:04
Message: <chrishuff-E4D2C3.09313425032002@netplex.aussie.org>
In article <3c9f2019@news.povray.org>,
 "Thorsten Froehlich" <tho### [at] trfde> wrote:

> You implementation of operations as classes is a nice idea but a perfect speed
> killer, too.

I'm really not sure what the best way to do them is, I plan to do some 
tests. I basically see three possible ways:
1: A struct of an integer value and whatever needed data, a big enum, 
and a giant switch (which alpha 1 and 2 used, it got pretty messy).
2: A struct of a function pointer and data.
3: A class with a virtual function.
However, I don't really see how a virtual function would be considerably 
slower than function pointers. And it seems faster than it was before, 
though I have made too many changes to accurately judge. Previous 
versions used a giant switch statement, which was difficult to work with.
I'll probably keep the use of objects to create the operations, even if 
they just get converted to something else. The constructors give a 
convenient way of giving the needed information to the operation.


> As for the source code, to every header of the file at least add one or two
> lines that explain what the code in this files does.  Without it one has to
> read the source code or look for the function names the guess which purpose
> some file has as part of the whole.

I've still got a lot of work to do on documentation...

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

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