Slow performance compared to C++, ideas?

Marco Leise Marco.Leise at gmx.de
Sat Jun 1 13:43:32 PDT 2013


Am Sat, 01 Jun 2013 11:22:41 -0700
schrieb Walter Bright <newshound2 at digitalmars.com>:

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

Yes, that's the easiest (and for Ray the right(tm)) way to get
rid of virtual functions. But, I think it is safe to assume
that there will be different object classes in the big picture.

-- 
Marco



More information about the Digitalmars-d mailing list