Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Slowness when drawing fonts

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
Slowness when drawing fonts
Peter Wang
Member #23
April 2000

D3D should have benefited from the same change. Post your results for that?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Matthew Leverton
Supreme Loser
January 1999
avatar

matthew@mercury:~/tmp$ ./font50
Average load time     = 0.476 ms
Average cache time    = 8.766 ms
Average display time  = 0.440 ms
Test count = 1012

matthew@mercury:~/tmp$ ./font51
Average load time     = 0.316 ms
Average cache time    = 4.946 ms
Average display time  = 0.586 ms
Test count = 1013

Looks like cache time has dropped but display time has increased (OpenGL). This is 5.0 compared to 5.1 SVN.

Peter Wang
Member #23
April 2000

Ah, that's not good. I modified the benchmark to better represent what a real program does, but the slowdown is still there (0.060 ms/call to 0.066 ms/call on my machine). The problem seems to be simply making the second pass over the string.

Since drawing speed is a lot more important than caching speed, I guess I'll have to back out that part of my changes.

EDIT: but we can still do it when the caching is done as part of computing text dimensions. Done in SVN.

Matthew Leverton
Supreme Loser
January 1999
avatar

The latest SVN was even slower with the original test (~0.586 to ~0.644).

But with your test program, SVN is the same speed as 5.0.

Peter Wang
Member #23
April 2000

Try turning off cpu throttling. I wouldn't put too much stock in the original test anyway, at least the drawing part. It does too little of it and is likely impacted by all the other things going on.

ex_ttf should be more representative of real programs. On my machine it went from ~4800 FPS to ~5500 FPS (cpu throttling disabled). Most of that should be attributed to the improvements to al_get_text_dimensions.

Matthew Leverton
Supreme Loser
January 1999
avatar

Manually maxing the CPU frequency didn't change things.

ex_ttf is slightly (<2%) faster in SVN than 5.0. (Integrated Intel GMA950.)

Peter Wang
Member #23
April 2000

Can you also test r14782 instead of 5.0? That's what I have been comparing. The 5.1 seems to have regressed slightly due to other changes.

Matthew Leverton
Supreme Loser
January 1999
avatar

The latest is about 7% faster than 14782 on ex_ttf.

Peter Wang
Member #23
April 2000

r14533 is the culprit.

Quote:

Make al_compose_transform do a full 3d multiply. Add some possibly necessary (for 3d) bits to al_ortho_transform

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Okay, finally got all of A5 built from SVN.

I compared the results from 5.0.2 earlier to SVN r14784 (after your initial fix) and to SVN r14796 (latest) and these are the times I came up with :

All times in milliseconds
-------------------------------------------------------------
                |   load   |  cache   |  cache2  | display  |
-------------------------------------------------------------
OpenGL          |          |          |          |          |
----------------|----------|----------|----------|----------|
5.0.2           |    0.639 |   41.820 |    0.014 |    0.295 |
5.1SVN r14784   |    0.643 |   15.076 |    0.030 |    0.336 |
5.1SVN r14796   |    0.619 |   13.344 |    0.017 |    0.437 |
-------------------------------------------------------------
Direct3D        |          |          |          |          |
----------------|----------|----------|----------|----------|
5.0.2           |    1.278 |  310.100 |    0.021 |    0.202 |
5.1SVN r14784   |    0.680 |   86.996 |    0.034 |    0.197 |
5.1SVN r14796   |    0.653 |   32.468 |    0.020 |    0.199 |
-------------------------------------------------------------

Direct3D is looking really nice now, and the caching time is comparable with OpenGL. The cache times for the latest svns for OpenGL have definitely improved too.

The only thing that might have gotten worse is display times for the latest svn version for OpenGL.

Peter Wang
Member #23
April 2000

Thanks for testing. But I don't know what to think. Can you post results for ex_ttf?

Elias
Member #358
May 2000

r14533 is the culprit.

That should have affected OpenGL and D3D equally [1] Wonder what else (specific to OpenGL) made drawing slower.

--
"Either help out or stop whining" - Evert

Evert
Member #794
November 2000
avatar

What's the errorbar on those numbers?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Evert said:

What's the errorbar on those numbers?

You mean the statistical variance? I have no idea. I ran the program until the numbers had pretty much stabilized. For OpenGL, it ran fast enough that it had made between 500 and 1000 tests. For Direct3D with 5.0.2 it probably only took 100 tests (which took about 30 seconds for it). The later Direct3D versions are probably comparable to the number of tests for OpenGL.

Thanks for testing. But I don't know what to think. Can you post results for ex_ttf?

Here you go :

                   |        FPS
-------------------------------
5.0.2              |  1000-1150
5.1 SVN r14784     |   900-1000
5.1 SVN r14796     |   975-1175
--------------------------

I did my best to give the most common ranges for the program. It would probably give better results if the fps was averaged.

 1   2   3   4 


Go to: