[SDL] Looking for ideas to speed things up a little...

KHMan keinhong at gmail.com
Thu Mar 8 01:29:20 PST 2012


On 3/8/2012 4:15 PM, Gordon Henderson wrote:
>[snip snip]
> But that's just one little test project, I have another project on
> the go which I've just convered from curses to SDL - curses has a
> similar screen refresh scenario, so it's not been too hard to
> emulate, although getting it right is tricky - e.g. my program is
> interpreting a little script and the script prints data to the
> screen - do I do an update after every bit of data (which could be
> a single character and thus slow-down the entire system), or after
> every line (could look really slow if it prints 2 nubers on the
> same line, then does calculations and prints a 3rd and a newline 5
> minutes later), and so on.... Plenty of room to experiment and get
> the right balance though.

I've ran stuff that spewed a tremendous amount of stuff on a shell 
window... but then it ran much faster without doing any such 
updates. So the former did indicate a lot of progress, but cut 
performance. Decoupling processing and visual updates is probably 
a good thing if performance is desirable.

If you try 7-zip, say on a big folder, the progress dialog box 
updates only several times a second (but long enough for filenames 
to register in your brain), even if it is actually processing 100 
files per second (even with a per-file method like zip/deflate.) 
It is doubtful whether a faster update (e.g. 50 filenames per 
second) would be useful to the user. Of course, a full log file 
has its uses too, but it may not be needed for normal usage. So 
the 7-zip progress dialog box is what I would consider a 
well-designed UI.

-- 
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia



More information about the SDL mailing list