Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 5
Registered: ‎04-18-2009
My Device: Not Specified

touchEvent performance issues

So I'm trying to make a video game for a Storm. The main "game screen" is implemented by extending FullScreen. I've benchmarked the performance hit from "hovering" your finger on the screen to about 35-40%. Is there a way to avoid this?

 

It is a fast action type game and it is controled by "hovering / moving" your figer in the direction where you want to move. I am noticing that touch events are KILLING my frame rate. I'm talking about 40% performance drop just because touch events are beeing generated.

 

I've spent the last 3 hours building a benchmark .. where I have a "main" thread doing busy work (rendering to off screen buffers) and I am just counting the number of touch events that come in, and discard them (return true).

 

When i just run the app (without touching the screen) I get about 205 renders / second. When I start to generate touch events (real touching the screen, no injected events), I am getting around 1.50% performance degradation per touch event per second.

 

So generally speaking hovering / moving your finger on screen generates about 25 touch events per second .. which comes to 35-40% performance hit. It there any way to avoid this huge performance hit?

 

New Developer
Posts: 13
Registered: ‎09-08-2008
My Device: Not Specified

Re: touchEvent performance issues

I imediately return from gesture and cancel as my UI and games don't care about them.  I have also experimented with only taking the most recent move event every time my update function loops.
Developer
Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: touchEvent performance issues

Are you doing any logging in your touch event method?  That could be causing some sort of overhead.  You can also profile in the JDE to see what is using what percentage of the simulator cpu.
Kurt Zettel | Chief Architect | Metova
www.metova.com
Highlighted
New Developer
Posts: 5
Registered: ‎04-18-2009
My Device: Not Specified

Re: touchEvent performance issues

I'll post the exact benchmark code I use tomorrow, I'm too tired to do it now. but the touchEvent() code looks like this:

 

    protected boolean touchEvent(TouchEvent message) {
        touches++;
        return true;
    }

 

This problem only shows up on the real device. As you all might have noticed, the performance of the emulator has very little to do with the performance of the real device.