[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-dev] Performance drop [really trig functions]
From: |
Jon Steinhart |
Subject: |
Re: [Gnash-dev] Performance drop [really trig functions] |
Date: |
Tue, 29 May 2007 10:34:57 -0700 |
Eric wrote:
> I haven't delved at all into it in any depth, but when I looked at the
> matrix code last month I did notice one thing I was going to recommend:
> storing both canonical matrix parameters and the matrix itself and
> computing the matrix only when necessary. In other words, treating the
> matrix values as a cache. When matrix canonical values are assigned, all
> the trigonometric function are recomputed, which is going to be the most
> expensive operation of the lot.
>
> Perhaps better: when assigning canonical values, check them against
> existing canonical values. If the same, do nothing. If different, update
> the value and invalidate the matrix values. When performing a matrix
> operation, check validity first and recompute if necessary.
>
> In the same vein, caching the sine and cosine of the canonical rotation
> value means that changing only the scale wouldn't incur any new
> trigonometric computation. In such a case the multiplications would dominate.
>
> I don't know enough about how the matrix computations fit within the
> overall control scheme of the player, but if they're in anything like an
> inner loop, caching these calculations should significantly improve
> performance.
>
> Eric
My 2 cents on matrix computations; might want to have an option to use cordic
functions to do your trig on devices that don't have hardware for it.
Jon
Re: [Gnash-dev] Performance drop - found it!, Udo Giacomozzi, 2007/05/30