Re: [AD] XIM patch for Allegro 4.1.x

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


On Tue, 2004-10-26 at 17:19 -0700, Chris wrote:
> On Wed, 27 Oct 2004 00:01:19 +0200, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> > What I gathered from a manpage I dug up on google is that you don't need to
> > bother with XLock if you already use mutexes to prevent several threads
> > from accesing X at the same time. In other words, your code should be good
> > according to the manpage.
> 
> If that can be gauranteed behavior, then I don't have any more
> objections, assuming the testing goes alright.
> 

I ran the "profile screen" in the test program - results are pasted
below, between current CVS, and current CVS with the XIM patch attached
(first for XWIN, then for DGA2).

I just wanted to make sure the patch doesn't possibly introduce a
performance loss due to XLock doing something clever, which would be
lost with the pthreads mutex - but doesn't look so.

I have no explanation why some of the XWIN results appear to be faster
(cmplog says 200% for solid line and circle) with the patch - probably
it has to do with the way Allegro asynchronously updates the screen, and
some overhead of XLock somehow gets accumulated by this (?). DGA shows
everything to be slightly slower, but maybe that's just fluctuations, I
did run this inside Gnome after all. Or it may be some small overhead
introduced by pthreads. But then, XWIN shows just the opposite,
everything seems to be faster. In summary - using a pthreads lock
instead of XLock will probably have zero effect on actual programs,
performance-wise.


-- test program results XWIN
Comparing test profile logs tests/profile.log
and ../allegro_k/tests/profile.log

DRAW_MODE_SOLID results:

	putpixel()                       = 128%
	hline()                          = 126%
	vline()                          = 118%
	line()                           = 197%
	rectfill()                       = 109%
	circle()                         = 204%
	circlefill()                     = 155%
	ellipse()                        = 192%
	ellipsefill()                    = 150%
	arc()                            = 185%
	triangle()                       = 158%


DRAW_MODE_XOR results:

	putpixel()                       = 127%
	hline()                          = 124%
	vline()                          = 110%
	line()                           = 185%
	rectfill()                       = 99%
	circle()                         = 196%
	circlefill()                     = 150%
	ellipse()                        = 185%
	ellipsefill()                    = 146%
	arc()                            = 175%
	triangle()                       = 152%


DRAW_MODE_COPY_PATTERN results:

	putpixel()                       = 123%
	hline()                          = 120%
	vline()                          = 109%
	line()                           = 107%
	rectfill()                       = 101%
	circle()                         = 106%
	circlefill()                     = 107%
	ellipse()                        = 107%
	ellipsefill()                    = 107%
	arc()                            = 107%
	triangle()                       = 106%


DRAW_MODE_SOLID_PATTERN results:

	putpixel()                       = 123%
	hline()                          = 120%
	vline()                          = 108%
	line()                           = 107%
	rectfill()                       = 98%
	circle()                         = 106%
	circlefill()                     = 107%
	ellipse()                        = 106%
	ellipsefill()                    = 105%
	arc()                            = 107%
	triangle()                       = 106%


DRAW_MODE_MASKED_PATTERN results:

	putpixel()                       = 124%
	hline()                          = 120%
	vline()                          = 109%
	line()                           = 106%
	rectfill()                       = 101%
	circle()                         = 107%
	circlefill()                     = 107%
	ellipse()                        = 107%
	ellipsefill()                    = 107%
	arc()                            = 106%
	triangle()                       = 106%


DRAW_MODE_TRANS results:

	putpixel()                       = 121%
	hline()                          = 114%
	vline()                          = 108%
	line()                           = 106%
	rectfill()                       = 101%
	circle()                         = 105%
	circlefill()                     = 104%
	ellipse()                        = 106%
	ellipsefill()                    = 103%
	arc()                            = 107%
	triangle()                       = 105%


Other functions:

	textout()                        = 104%
	vram->vram blit()                = 101%
	aligned vram->vram blit()        = 101%
	blit() from memory               = 102%
	aligned blit() from memory       = 98%
	vram->vram masked_blit()         = N/A
	masked_blit() from memory        = 101%
	draw_sprite()                    = 102%
	draw_rle_sprite()                = 102%
	draw_compiled_sprite()           = 100%
	draw_trans_sprite()              = 101%
	draw_trans_rle_sprite()          = 102%
	draw_lit_sprite()                = 101%
	draw_lit_rle_sprite()            = 103%

-- test program results DGA
Comparing test profile logs dgaprofile.log
and ../allegro_k/dgaprofile.log


DRAW_MODE_SOLID results:

	putpixel()                       = 108%
	hline()                          = 130%
	vline()                          = 111%
	line()                           = 99%
	rectfill()                       = 99%
	circle()                         = 99%
	circlefill()                     = 99%
	ellipse()                        = 100%
	ellipsefill()                    = 100%
	arc()                            = 100%
	triangle()                       = 99%


DRAW_MODE_XOR results:

	putpixel()                       = 102%
	hline()                          = 99%
	vline()                          = 100%
	line()                           = 96%
	rectfill()                       = 95%
	circle()                         = 100%
	circlefill()                     = 97%
	ellipse()                        = 100%
	ellipsefill()                    = 99%
	arc()                            = 100%
	triangle()                       = 104%


DRAW_MODE_COPY_PATTERN results:

	putpixel()                       = 107%
	hline()                          = 102%
	vline()                          = 100%
	line()                           = 100%
	rectfill()                       = 98%
	circle()                         = 100%
	circlefill()                     = 99%
	ellipse()                        = 99%
	ellipsefill()                    = 100%
	arc()                            = 100%
	triangle()                       = 99%


DRAW_MODE_SOLID_PATTERN results:

	putpixel()                       = 106%
	hline()                          = 101%
	vline()                          = 100%
	line()                           = 100%
	rectfill()                       = 99%
	circle()                         = 98%
	circlefill()                     = 99%
	ellipse()                        = 100%
	ellipsefill()                    = 100%
	arc()                            = 100%
	triangle()                       = 99%


DRAW_MODE_MASKED_PATTERN results:

	putpixel()                       = 106%
	hline()                          = 102%
	vline()                          = 101%
	line()                           = 100%
	rectfill()                       = 100%
	circle()                         = 100%
	circlefill()                     = 99%
	ellipse()                        = 100%
	ellipsefill()                    = 99%
	arc()                            = 100%
	triangle()                       = 100%


DRAW_MODE_TRANS results:

	putpixel()                       = 102%
	hline()                          = 100%
	vline()                          = 100%
	line()                           = 100%
	rectfill()                       = 102%
	circle()                         = 99%
	circlefill()                     = 96%
	ellipse()                        = 99%
	ellipsefill()                    = 102%
	arc()                            = 100%
	triangle()                       = 94%


Other functions:

	textout()                        = 99%
	vram->vram blit()                = 100%
	aligned vram->vram blit()        = 99%
	blit() from memory               = 98%
	aligned blit() from memory       = 99%
	vram->vram masked_blit()         = 100%
	masked_blit() from memory        = 98%
	draw_sprite()                    = 100%
	draw_rle_sprite()                = 98%
	draw_compiled_sprite()           = 100%
	draw_trans_sprite()              = 100%
	draw_trans_rle_sprite()          = 100%
	draw_lit_sprite()                = 99%
	draw_lit_rle_sprite()            = 99%

-- 
Elias Pschernig





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