[Sugar-devel] [Dextrose] [PATCH v5 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
quozl at laptop.org
Thu Oct 28 19:56:25 EDT 2010
On Thu, Oct 28, 2010 at 03:44:37PM -0300, Gonzalo Odiard wrote:
> I think the problem is the code is rendering the svg icon every time
> the color is changed. There are not cache or cairo operation used to
> avoid this.
I agree. Martin Dengler's stats graph confirms it.
Anurag is proposing skipping the paint after the first rendering. It
remains a puzzle to me why the first frame rendering takes so much
longer than the remaining frames.
In Netrek when I faced this kind of problem, I solved it by
pre-rendering a reduced number of frames, or at least caching the
The frame rate is 10 Hz. The _phase is continually incremented, and the
level is set using:
self._level = (math.sin(self._phase) + 1) / 2
The first two seconds uses these levels:
Now if these were filtered to a reduced set of levels, the rendered
images could be cached and re-used.
N = 10
self._level = int(math.sin(self._phase) + 1) / 2 * N) / N
However, this moves the problem from CPU cycle cost to memory cost.
More information about the Sugar-devel