background icon prerendering performance
As some of you may have noticed, JonCruz implemented my idea about prerendering the icons as a background task. It seems to work very, very well. Good work, Jon.
Basically the idea is that the GUI icons get rendered one-at-a-time in the brief pauses between mouse motions or keypresses, when Inkscape isn't otherwise busy.
On my lowly Celeron 500, it takes about 60ms (average) to render a single icon; a few icons take a bit longer (as much as 175-200ms).
Even while I'm doing other stuff, it seems to take only 15-25 seconds to get all the menu icons rendered, during which time I can draw or navigate around the fileselector or something (the File menu renders first). By the time I start using the menus, their icons have usually been rendered.
Compare this to the situation we used to have: formerly, the first time you clicked on the Object menu, on a machine like mine you were guaranteed at least a:
70ms*16 = 1120ms = 1.12s
delay. And that's something of a best case. Let's not even think about what it used to be like when we rendered all the icons up-front at startup time...
This is a vivid demonstration of how doing the same amount of work more cleverly can make an application feel a lot more responsive.
Anyway, I've refactored the code a little bit and also stuck in some timers to assess rendering performance. The g_warnings are temporary; I'd just like to get a sense of how common it is for the rendering of icons to run over 70ms on different people's machines right now.
Ultimately I'd like to get some incremental rendering code in place, not just for background icon rendering, but also for other things, like previews in the file dialog. It's really annoying to select a complex file in the fileselector and have to wait for its preview to finish rendering before you can do anything.
-mental
On Dec 1, 2005, at 6:06 PM, MenTaLguY wrote:
Anyway, I've refactored the code a little bit and also stuck in some timers to assess rendering performance. The g_warnings are temporary; I'd just like to get a sense of how common it is for the rendering of icons to run over 70ms on different people's machines right now.
One thing to look for is which type of build people are running.
On my same machine, I noticed only a tiny menu delay with a release build, but with -O0 on my developer builds I get something very noticeable. So noting the compile flags people use can be quite handy in this.
On 12/1/05, MenTaLguY <mental@...3...> wrote:
Basically the idea is that the GUI icons get rendered one-at-a-time in the brief pauses between mouse motions or keypresses, when Inkscape isn't otherwise busy.
Can it also prerender the marker previews from markers.svg? It would be very nice.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
participants (3)
-
bulia byak
-
Jon A. Cruz
-
MenTaLguY