Omni
|
So I was working on a way to optimize a drawing function and I decided to just test some stuff to see what happens. Here are some results, maybe they'll help someone. All graphics functions were done with a 640x480 image.
Some functions have more than one time, because I ran them more than once. Essentially I looped each test 5,000 times in a FOR() loop and checked the time.
5,000 cycle tests.
[Number] [Test] [Time] (in centisecs)
1 No function 1
2 NewImage, Blit, FreeImage 2486, 2473
3 ImageShell, FreeImage 10
4 RectFill 640x480 3
5 Blit (640x480) 2
6 RotScale (640x480, 1000 scale) 4253, 4204
500 scale 4156, 4156
2000 scale 1830
1000 scale, 35 angle 4879
500 scale, 35 angle 4547
2000 scale, 35 angle 2552
7 RotScale (640x1, 1000 scale) 2616
500 scale 2610
2000 scale 895
100 scale (ie, 10x bigger) 2646
1000 scale, 35 angle 2614
500 scale, 35 angle 2632
2000 scale, 35 angle 878
8 RotScale (640x1, 1000 scale), 480 times took too long -- no patience to wait for completion
9 SetLucent-50, AdditiveBlit 640x480, SetLucent-0 12
10 SetLucent-30, AdditiveBlit 640x480, SetLucent-0 27
11 AdditiveBlit 640x480 (lucency at 0) 27
12 AdditiveBlit 640x480 (lucency at 50) 12
12 Variable assignment by function 2
variable = ImageHeight(screen)
13 Variable assignment by variable 0
variable = timer
14 SetLucent (something), SetLucent 0 2
Conclusions/Thoughts
1. NewImage() is very slow compared to ImageShell
2. Scaling an image down with Rotscale decreases the render time.
3. Scaling an image up past the clipping area decreases the render time,
when compared with an image that takes up _all_ the clipping area.
(though the difference seems to be negligible)
4. Rotation seems to increase the render time for a RotScale by approx. 1/8th.
5. RotScale rendering must be based on the destination--
an item scaled insanely huge (10x) takes the same time as a normal RotScale that will fit the image's dimensions.
6. Reducing the actual amount of source data decreases the RotScale render time,
but not by the proportion of source data loss.
(ie, scaling the source data down by 1/2 will not make RotScale run twice as fast).
7. AdditiveBlit seems to run _faster_ when 50% lucency in enabled.
--any other lucency causes the speed to be as if lucency was not enabled.
Posted on 2005-06-17 22:36:39
|
Overkill
|
Quote:Originally posted by Omni
Oh bloody. I forgot all about that. I haven't been downloading these bleeding-edge releases.
(if that's what you mean by the June '05 exe)
EDIT: speaking of which...um...where do you find those, again?
I wonder if there is a way to make AdditiveBlit alone as fast as AdditiveBlit with 50% lucency. It stinks to think that my blit is twice as slow just because I'm not using lucency.
http://vecna.verge-rpg.com/verge.exe is the place to go, then http://vecna.verge-rpg.com/v3vergec.txt and http://vecna.verge-rpg.com/v3changes.txt for more stuff.
Posted on 2005-06-18 15:45:02
|