There are issues with the system responding to touch events. Search
this group for more details. The short of it is to use Thread.yield()
in the onTouch.
Could the slow down be due to overdraw with stuff like particles? So
far on the Milestone the only 3d performance problem I have seen is
fillrate/overdraw.
I wrote a very simple profiler that I can use to find roughly which
areas are running slow. I would invest time in doing this. Even though
this profiler is intrusive it still shows the areas. Don't over
engineer it. A simple static list of profile points is all you need.
Store stuff like number calls, total time, highest time etc. Spit out
the profile once every couple of seconds. BTW this is where a
preprocessor can help buy conditionally compiling profiling out.
Make sure you're rendering is on it's own thread as it will block.
Add support to track the number of triangles rendered and spit it out
once every 5 secs.
Make a toggle to shut off rendering and see what the framerate does so
you can be sure it's not in the game sim. Even better add support to
toggle various systems off.
Leigh
On 6/15/2010 9:23 AM, [email protected] wrote:
Nellz,
Yes, this is really hard to figure out, which is why I am posting
here. I am getting a consistent 40-50 FPS with my pretty complicated
3D app, but I get these wierd frames that take 100-200 msecs to run,
and it is unexplained for me.
NightWolf,
I have instrumented my code to try to see which methods are taking up
the time. In fact, I have gone a lot finer than just seeing how long
a render takes. I am timestamping and recording max deltas in several
spots in my movement code and I am timestamping and recording deltas
for the render code.
The delay appears randomly in all instrumented chunks of code, so it
doesn't seem specific to any code. It seems like "something else"
other than my app. Also, boosting my priority has helped but not
fixed the problem. The fact that it helps also seems to point to
something else running.
When the glitch happens between when I have calculated the movement
and when I go to render the movement, then the game stutters. When
the glitch happens between renders but not in between move and render,
then it is not so bad because the movement is accurately calculated
for the time that expired and the render happens soon afterwards.
--
Leigh McRae
www.lonedwarfgames.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en