Slow performance compared to C++, ideas?
Martin Nowak
code at dawg.eu
Sun Jun 2 10:19:33 PDT 2013
On 06/01/2013 08:22 PM, Walter Bright wrote:> On 5/30/2013 7:56 PM,
Andrei Alexandrescu wrote:
>> On 5/30/13 9:26 PM, finalpatch wrote:
>>> https://dl.dropboxusercontent.com/u/974356/raytracer.d
>>> https://dl.dropboxusercontent.com/u/974356/raytracer.cpp
>>
>> Manu's gonna love this one: make all methods final.
>
> I have another suggestion. class Sphere and class Ray should be structs.
> Neither class uses polymorphism in any way, so there's no reason to make
> them classes with virtual functions.
>
I was about to write that too, but when the goal is to write a
scenegraph polymorphism is what you want, i.e. Sphere is just one object
and there is different lights. Ray already is a struct.
More information about the Digitalmars-d
mailing list