Hi Andre,

Everyone here has brought up great points:
1) Matrix manipulation is slow. Instead, rotate and store bitmaps
ahead of time (note: initial loading time will be longer).
2) Don't use getter/setters, instead make commonly used attributes
public.
3) Don't call System.currentTimeMillis() or other methods so
frequently just cache the value (also, use System.uptimeMillis()
instead, see: 
http://groups.google.com/group/android-developers/browse_thread/thread/f355a2fde748e0c9).
4) Learn the performance doc by heart and follow its guidelines. I
recommend always keep performance in the back of your mind and
optimize frequently.
5) Never let the garbage collector run during gameplay, manually
invoke the GC during lulls.

Also, I noticed you are calling asteroid.width / 2. Don't do this.
Instead, cache the value (halfWidth = width / 2) or, if you must, use
width >> 1.

I'd also be more than happy to test your game. If you email me or post
it here, I'll let you know how it runs on my Google Ion (MyTouch).


- Jason

On Jan 20, 4:14 pm, Zsolt Vasvari <zvasv...@gmail.com> wrote:
> I was previously involved with game emulator development.  No way that
> the speed of the emulator for a 500+ Mhz processor will be faster on a
> 2GHz computer than the real device.
>
> It doesn't matter if it's dual-core or not -- processor emulation is
> pretty much single threaded.
>
> On Jan 21, 2:15 am, Frank Weiss <fewe...@gmail.com> wrote:
>
> > I wouldn't expect a emulated code to run faster than on the target hardware.
> > Perhaps you are assuming that the emulated code is using the graphics
> > directly. Question is, does it?
>
> > On Jan 20, 2010 9:42 AM, "Dan Sherman" <impact...@gmail.com> wrote:
>
> > I'm not running any sort of beastly machine, quad-core 2.8ghz, with an
> > nvidia 9800gtx, and almost all the time, emulator performance is lower than
> > physical device (especially with openGL, but even with canvas).  Might have
> > something to do with the emulator specifically on linux, so your results may
> > vary.  As for uploading your APK, just drop it on rapidshare or something
> > and post the link.
>
> > - Dan
>
> > On Wed, Jan 20, 2010 at 11:37 AM, Kevin Duffey <andjar...@gmail.com> wrote:
> > > > After I wrote you,...
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubs­cr...@googlegroups.com>
> > For more options, visit this group 
> > athttp://groups.google.com/group/android-developers?hl=en
>
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to