Re: [AD] Poor Ming performance

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


> Attached is the results from profiling the screen with CVS allegro with
> DJGPP and MingW32.
>
> The DJGPP port is vastly superior in speed in every respect ... arrg!

You're a little hard for the Windows port, don't you think ?
vram->vram blit: djgpp 3047, mingw32 107357

> Any heads up on why the big speed diff?

You have to be aware of the main difference between DOS and Windows: a DOS
app has full access to every resource of the system, whereas a Windows app
must share it with the kernel and other apps.

For gfx operations, this ends up with the need to first acquire and then
release the screen each time a drawing operation is performed (in DirectX
language: to lock/unlock the primary surface) and this is very slow.

Look at the putpixel() test: djgpp 3393810, mingw32 174613
For *each* pixel drawn onto the screen, Allegro must acquire/release the
screen and this is a huge overhead.

Now look at the circle() test: djgpp 38270, mingw32 41810
For *each* circle, Allegro still must acquire/release the screen but this
overhead is nothing compared with the drawing operation itself.

Conclusion: you have to group as much as possible the drawing operations
under Windows between one call to acquire_screen() and one call to
release_screen().

Try the following modification: edit test.c in the tests directory,
function putpix_demo(), and add a pair of acquire_screen()/release_screen()
around the while loop. Now re-run the putpixel() test.

------------
Little bit off topic:
I found some time ago weird things related to hardware acceleration on my
box:

DirectDraw soft                     DirectDraw accel
circle()        - 9400                 circle()        - 9436
circlefill()    - 7393                  circlefill()    - 726
ellipse()       - 6670                 ellipse()       - 6675
ellipsefill()   - 6043                  ellipsefill()   - 700

Basically, filling in a circle with hardware-accelerated horizontal lines is
slower than with regular lines.
Is anyone experiencing the same thing under Windows ? with other
hw-accelerated drivers (BeOS, DGA 2) ?

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



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