Page 1 of 1

Performance issues

PostPosted: Aug 25, 2007 @ 4:30am
by namGman

PostPosted: Aug 26, 2007 @ 5:07am
by namGman
I'm not sure that I solved anything, but after some testing modifications my perspective has changed a bit.

I transitioned my Gapidraw code to be closer to the Edgelib version (apart from the diff in gfx libraries the code should be exactly the same now) and found the the GapiDraw version is experience a performance drop as well. (both versions run fullscreen whereas my original gapidraw code runs in windowed mode based off the GDIDemo sample)

However the startup tests still are very clear that something is not right with my edgelib code. The fullscreen GapiDraw version still starts up instantaneously whereas the Edgelib version (after some proper timing checks) actually takes about 17-20 seconds to start. Unfortunately that is very much too slow for reasonable development.

Thanks.

PostPosted: Aug 27, 2007 @ 9:02am
by edge

PostPosted: Aug 27, 2007 @ 8:02pm
by namGman
Hi,

Now that I've found the problem this probably doesn't matter, but to answer your questions I am creating my surfaces in the OnDisplayInit method and I am testing on a Dell Axim 51v.

To have a better look I wrapped the edgelib api calls with timing counts using ClassERTimer::Count() (very handy btw! :) ) and did some rough timing measurements.

(in milliseconds)
new surface: 0 (new E2DSurface())
create surface: 0 (display->CreateSurface(...))
resize surface: 1466 (surface->Resize(w,h))

So it's pretty obvious where the problem is!! surface->Resize(..) doesn't seem to be documented but as I scrolled through my IntelliSense window seemed like the obvious choice for resizing a surface. And it does it's job but seemingly performance isn't it's key feature. What is the context in which this method should be used? Is it deprecated?

Anyway I switched out the Resize call with display->CreateSurface and the time of 1466ms dropped down to 5ms. :) As a result I am finding the startup time to be just fine and am excited to proceed with my evaluation of edgelib. :)

Something to note is that the call-times to CreateSurface seem to increase for each of the first 3 calls, ~(0-5-20), but then drop back down to ~0 for any further calls. I messed around with the width and height parameters but they didn't seem to have an effect. I don't have anything concrete around this, but found it interesting so I thought I would pass it on. Whatever it is, it's not causing me any problems :)

Thanks

PostPosted: Aug 28, 2007 @ 7:41am
by edge
Hi,

Surface resizing could be used to handle different resolutions. For example, you could supply one graphics pack with the title screen, backdrop images and resize them to fit for each resolution. Performance isn't the most important part of this feature, it will resize with image resampling to make it look good when scaled down (it is quite similar to resizing an image with photoshop). We recommend using a loading progress bar when loading (and resizing) resources.

The different timings for CreateSurface may be caused by the fact that the operating system can use processing power while the application runs. This is usually true when just starting the application.

When you want to resize real-time (for example, for rotating/scaling sprites) we recommend using Blt(). This will not resample your images and has a high performance.

PostPosted: Aug 28, 2007 @ 2:37pm
by edge
PS: We forgot to add the Resize function to the reference documentation. Good thing you pointed this out to us.

Find the entry for E2DSurface here:
http://www.edgelib.com/index.php?node=e2dsurface_resize

PostPosted: Aug 28, 2007 @ 10:49pm
by namGman
Hi,

Thanks for the info and I'm glad to see the documentation up for Resize. It might be helpful to mention in the description what options would be better suited if the developer is looking for "real-time" resizing. (at least for newbie's like myself)

Just as some feedback, I think it would be helpful if your function listings were sorting alphabetically. Due to the current format I needed to scan the list of functions for E2DSurface numerous times before I could confirm to myself that it was indeed not there. ;)

I'd also like to mention in reference to the thread topic that everything is now running very well.

Thanks for the help. :)

PostPosted: Aug 29, 2007 @ 9:25am
by edge

PostPosted: Aug 30, 2007 @ 5:50am
by namGman
I'd planning to have an alpha/beta testing version up on the net in ~1 month. The application isn't focused on graphics and this is my first foray into the scene so I don't plan to have the application looking amazing for the initial release. I do however appreciate a good interface and very much hope to eventually produce a very slick and intuitive experience for my users.

Anyway, I'll definitely let you know when it's up and going. :)