[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Chris wrote:
Peter Wang wrote:
Here's an alternative patch. The problem that occurred in the
blitting tests seems to be that when the screen was constantly
updated, Allegro would be making heaps of calls to Xlib to request
the X server to update the window contents. However, Xlib queues up
those requests and appears to discard or merge requests that it
thinks are redundant, e.g. overwriting the same parts of the screen
really quickly in succession.
Forget the discarding stuff. I used a program called xscope to look at
the requests that Xlib was making. There was (almost) a 1-1
correspondence between blit() calls made by a little test program and
the number of PutImage requests to the X server.
Anyhoo, talking to Chris on #allegro, I got the idea to flush Xlib's
output buffer at the end of release_bitmap(). That's what the patch
does. I guess it would cause more network traffic on a remote X server.
Right.. and I don't think we really need to worry too much about
remote X servers with Allegro programs. If someone's doing that they
should expect shoddy performance, IMO.
Agreed, at least for the current gfx API.
extrans and exalpha seems to have gotten jerkier after this patch.
So I also attached another patch that makes *them* yield ;-) which I
think they should be doing regardless.
True they should be yielding, but there's a problem. This patch is
designed to remove the jerkyness due to not yielding.. so why would
those two need yielding?
Hence the ;-) I don't know either.
And as a slight aside, any reason you made the one example use rest(1)
and the other use rest(0)?
I think I was just playing around trying to drop the CPU usage to zero.
I ran the test program with and without yield in the main performance
test loop. They both ran identically, but they also showed a massive
perfomance hit.
You're right. Well, I'm out of ideas. Let's go with your rest(0) patch
for test. I'd be more comfortable if it was only enabled while running
on X, though, otherwise it will probably decrease the rates for other
platforms.
Peter