[ODE] More speed???

Martin C. Martin martin at metahuman.org
Tue Nov 4 11:08:48 MST 2003


Nguyen Binh wrote:

> Hi list,
> 
>    I'm deep in optimizing ODE (mostly for speed).

Great!

 >    Here are some of my observations:
>    + There are many places to optimize in ODE

Such as?

>    + After just removing some dSetZero() calls and making use of
>    dSetZeroSSE(), I found that original Step rountine is no longer too
>    slow compare to Stepfast

That's surprising, since they're different time complexities.  What's 
the size of your islands?  How many bodies are you using?  Did you use 
some of the stepfast tests for comparisons, the ones with hundreds of 
bodies?

>    Most obvious ways to optimize:
>    a) Original Step code path:
>       The two most expensive functions are dSolveL1() and
>       dSolveL1T() (each of them take roughly 20% programs's CPU power).
>       These two function's purpose is to solve linear problem A.x = b
>       This result surprise me much.

What exactly is surprising?  That it takes a long time to solve a big 
set of linear equations?

>            -These two function can be SIMDize
>             easily. I have not tried it yet but I'd bet it will make
>             original Step() much faster.

Definitely!  Russ has suggested this a couple times.

>            - Or we can solve them using "iterative" method

That's what Stepfast does, as you point out below.

>    b) Stepfast code path:
>       ... one way to optimize is using specialized LCP for small matrix

How exactly would you specialize it for a 6x6 matrix?  For 2x2 or 3x3 
you could write out a single formula, which would save the 
storage/retreval of a few intermediate values.  But I doubt that would 
save you much with 6x6, and would just complicate the code, and might 
blow the instruction cache for example.  What did you have in mind here? 
  Just unrolling loops?

Best,
Martin




More information about the ODE mailing list