Re: [AD] Test patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


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.

This is probably the case. And it was my hope that X did something like this so it would take advantage of the XLOCKs and buffer the drawing requests so it would all happen at once. Though it appears that XUNLOCK doesn't explicitly flush the buffer, causing visual problems when you acquire the lock again before the buffer is flushed.

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.

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? And as a slight aside, any reason you made the one example use rest(1) and the other use rest(0)?

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. I was getting 16~19 thousand blits per sec without flushing the buffers but with yielding. Now I'm getting near 8 thousand blits per second with or without yielding. Though since it's really only locking/blitting/flushing/releasing it would scale well when doing more operations inside the lock.

- Kitty Cat




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/