address@hidden wrote:
Hey John, I'm looking at the math.scm code. I'm thinking it can't be
optimized because it's doing function calls for really small units of
math work. Especially for things like vector adds and multiplies. I'm
wondering if for really small functions like that, we're better off
letting it all be handled in Scheme. I haven't really delved into how
Chicken produces C code. But of course if we implement our own C
functions, Chicken can't produce that code.
I agree with what you're saying, but I've already been down that road: the
fact is that floating-point math in Chicken is sloooowww. All floats are
boxed, which is bad enough, but on top of that all simple math ops are a
function call.
If you'd like, I can write a math-scheme.scm or whatever and just
re-implement everything in scheme for comparison. I'll do it next time I
have access to my dev box -- should be later this week.
Are you saying that the fp+ fp- stuff is slow? Felix says it should be
generating inline code. If you've used those functions, please report
your experiences. If you haven't, then if you could write
math-scheme.scm in terms of them, so that we can see the output, that
would be good. I haven't heard whether you guys want to work with me
on 3D engine stuff or not, but I figure knowing where we stand with
basic math functions is useful.
Cheers,
Brandon Van Every
|