[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [grt-talk] Accuracy bug
From: |
Nikodemus Siivola |
Subject: |
Re: [grt-talk] Accuracy bug |
Date: |
Sat, 26 Apr 2003 01:00:15 +0300 (EEST) |
On Fri, 25 Apr 2003, Simon Adameit wrote:
> One possibility would be to use classes and replace our current
> intersects, normal, etc. functions with methods.
Classes yes. Methods no. But I'm not really sure of either...
Why? I've understood that the slot-access speed of classes vs. structs is
pretty much the same. And that's what we want: fast slot access.
And once we refactor the object struct into object, shape and texture
-structs it will mean two slot-accesses to get the shape / texture
functions. With classes we could move some of the logic into inheritance
and the compiler *might* be able to cheat and get the functions with a
single slot access. (I don't know if this makes sense to anyone but me...)
But methods. Ungh. All my tests so far indicate that method dispatch is
signifanctly slower then just getting function from a slot and calling it.
But I'm quite willing to believe this ain't so if someone can demonstrate
it to me. Maybe I'm just doing something wrong.
I don't know if you follow c.l.l, but I was just recently re-educated on
the benefits of classes versus structs even if there isn't a method in
sight... ,)=
But since this is a very potential bottleneck area all the options need to
be investigated, and compared. An elegant solution will win in my mind even
if it is *slightly* slower. But not much!
Cheers,
-- Nikodemus