gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] Performance drop


From: Eric Hughes
Subject: Re: [Gnash-dev] Performance drop
Date: Tue, 29 May 2007 11:38:23 -0600

At 11:00 AM 5/29/2007, Udo Giacomozzi wrote:
I compared the code for character.cpp and matrix.cpp but could not
find any relevant part that could cause this slow-down.

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]