Ninja demo: demo-apk run fast, but src->build-apk run very slow!

Started by kiffa, July 19, 2012, 07:26:34 AM

Previous topic - Next topic

kiffa

Hi all:

  I download Ninja demo, which provided a demo-apk and demo-src.

  First, i installed demo-apk on my phone, it run fast.(40 fps avg in mesh and skin animation).
  Then i import demo-src-project in eclipse,  build and installed on my phone, it run very slow!(only 3-8 fps in mesh animation).

   Why?
 
   There are what i did with the demo-src :

   1, import ninja-demo-src-project in eclipse.
   2, download Bone-api-src, and import it in ninja-demo-src-project.
   3, delete package: raft\jpct\bones\util,  delete raft\jpct\bones\BonesImporter.java
   4, set android-sdk-version: 2.3.3
   5, use jpct-ae-1.23-beta.jar which is included by ninja demo.
   
And when i entry Ninja-demo(src-build-demo),  the loading time is very long(1 minute), log-cat:

07-19 13:16:04.773: I/jPCT-AE(13394): onCreate
07-19 13:16:04.929: D/szipinf(13394): Initializing inflate state
07-19 13:16:04.937: I/jPCT-AE(13394): Wrapping input stream in a BufferedInputStream
07-19 13:16:04.937: D/szipinf(13394): Initializing zlib to inflate
07-19 13:16:23.039: D/dalvikvm(13394): GC_CONCURRENT freed 1176K, 24% free 14733K/19207K, external 3875K/4103K, paused 4ms+7ms
07-19 13:16:41.820: D/dalvikvm(13394): GC_CONCURRENT freed 1481K, 21% free 15182K/19207K, external 3875K/4103K, paused 4ms+8ms
07-19 13:16:58.781: D/dalvikvm(13394): GC_CONCURRENT freed 2127K, 24% free 15086K/19655K, external 3875K/4103K, paused 4ms+7ms
07-19 13:17:00.281: D/dalvikvm(13394): GC_FOR_MALLOC freed 472K, 23% free 15136K/19655K, external 3875K/4103K, paused 80ms
07-19 13:17:01.789: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 23% free 15158K/19655K, external 3875K/4103K, paused 80ms
07-19 13:17:02.976: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 23% free 15253K/19655K, external 3875K/4103K, paused 82ms
07-19 13:17:04.468: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 23% free 15302K/19783K, external 3875K/4103K, paused 80ms
07-19 13:17:05.687: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 23% free 15387K/19783K, external 3875K/4103K, paused 81ms
07-19 13:17:07.187: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 23% free 15447K/19911K, external 3875K/4103K, paused 81ms
07-19 13:17:08.734: D/dalvikvm(13394): GC_FOR_MALLOC freed 479K, 23% free 15524K/19975K, external 3875K/4103K, paused 80ms
07-19 13:17:09.921: D/dalvikvm(13394): GC_FOR_MALLOC freed 362K, 22% free 15669K/20039K, external 3875K/4103K, paused 80ms
07-19 13:17:11.382: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 23% free 15716K/20167K, external 3875K/4103K, paused 81ms
07-19 13:17:12.937: D/dalvikvm(13394): GC_FOR_MALLOC freed 479K, 22% free 15782K/20231K, external 3875K/4103K, paused 82ms
07-19 13:17:14.437: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 22% free 15849K/20295K, external 3875K/4103K, paused 81ms
07-19 13:17:15.968: D/dalvikvm(13394): GC_FOR_MALLOC freed 479K, 22% free 15915K/20359K, external 3875K/4103K, paused 82ms
07-19 13:17:17.125: D/dalvikvm(13394): GC_FOR_MALLOC freed 363K, 22% free 16053K/20423K, external 3875K/4103K, paused 80ms
07-19 13:17:18.671: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 22% free 16097K/20551K, external 3875K/4103K, paused 81ms
07-19 13:17:20.164: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 22% free 16164K/20615K, external 3875K/4103K, paused 86ms
07-19 13:17:21.726: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 22% free 16230K/20679K, external 3875K/4103K, paused 81ms
07-19 13:17:22.898: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 22% free 16369K/20743K, external 3875K/4103K, paused 81ms
07-19 13:17:24.429: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 22% free 16416K/20871K, external 3875K/4103K, paused 81ms
07-19 13:17:25.953: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 22% free 16484K/20935K, external 3875K/4103K, paused 83ms
07-19 13:17:27.492: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 22% free 16538K/20999K, external 3875K/4103K, paused 81ms
07-19 13:17:29.000: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 22% free 16616K/21063K, external 3875K/4103K, paused 82ms
07-19 13:17:30.265: D/dalvikvm(13394): GC_FOR_MALLOC freed 363K, 21% free 16751K/21127K, external 3875K/4103K, paused 80ms
07-19 13:17:31.742: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 16797K/21255K, external 3875K/4103K, paused 81ms
07-19 13:17:33.296: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 21% free 16864K/21319K, external 3875K/4103K, paused 134ms
07-19 13:17:34.796: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 16919K/21383K, external 3875K/4103K, paused 82ms
07-19 13:17:35.960: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 21% free 17066K/21447K, external 3875K/4103K, paused 82ms
07-19 13:17:37.484: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17117K/21575K, external 3875K/4103K, paused 82ms
07-19 13:17:38.953: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 21% free 17184K/21639K, external 3875K/4103K, paused 83ms
07-19 13:17:40.507: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17239K/21703K, external 3875K/4103K, paused 87ms
07-19 13:17:42.000: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 21% free 17317K/21767K, external 3875K/4103K, paused 87ms
07-19 13:17:43.234: D/dalvikvm(13394): GC_FOR_MALLOC freed 363K, 21% free 17452K/21831K, external 3875K/4103K, paused 84ms
07-19 13:17:44.687: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17498K/21959K, external 3875K/4103K, paused 81ms
07-19 13:17:46.226: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 21% free 17565K/22023K, external 3875K/4103K, paused 82ms
07-19 13:17:47.726: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17620K/22087K, external 3875K/4103K, paused 82ms
07-19 13:17:48.945: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 20% free 17770K/22151K, external 3875K/4103K, paused 82ms
07-19 13:17:50.398: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17818K/22279K, external 3875K/4103K, paused 83ms
07-19 13:17:51.953: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 20% free 17885K/22343K, external 3875K/4103K, paused 83ms
07-19 13:17:53.000: I/jPCT-AE(13394): created mesh keyframes, 144x2
07-19 13:17:53.093: D/dalvikvm(13394): GC_FOR_MALLOC freed 364K, 20% free 18026K/22407K, external 3875K/4103K, paused 83ms
07-19 13:17:56.078: I/jPCT-AE(13394): added new ninja: 1
07-19 13:17:56.085: I/jPCT-AE(13394): Adding Lightsource: 0
07-19 13:17:56.093: I/jPCT-AE(13394): onResume
07-19 13:17:56.242: D/GC(13394): <tid=13501> GC Version   : GC Ver0.8.0.4026-TD-Gingerbread-Beta5-SP4
07-19 13:17:56.257: I/jPCT-AE(13394): onSurfaceCreated
07-19 13:17:56.273: I/jPCT-AE(13394): Loading Texture...
07-19 13:17:56.281: D/skia(13394): JPEG Decode kDecodePixels_Mode
07-19 13:17:56.562: D/dalvikvm(13394): GC_EXTERNAL_ALLOC freed 575K, 20% free 18144K/22407K, external 3875K/4103K, paused 280ms
07-19 13:17:56.640: D/skia(13394): ---- Time (ms): IPP JPEG Decode 364
07-19 13:17:56.726: D/dalvikvm(13394): GC_FOR_MALLOC freed <1K, 20% free 18144K/22407K, external 4387K/5478K, paused 84ms
07-19 13:17:56.734: I/dalvikvm-heap(13394): Grow heap (frag case) to 25.371MB for 1048592-byte allocation
07-19 13:17:56.843: D/dalvikvm(13394): GC_FOR_MALLOC freed <1K, 19% free 19168K/23495K, external 4387K/5478K, paused 82ms
07-19 13:17:58.210: I/jPCT-AE(13394): Loading Texture...
07-19 13:17:58.234: I/jPCT-AE(13394): Loading Texture...
07-19 13:17:58.234: I/jPCT-AE(13394): onSurfaceChanged
07-19 13:17:58.242: I/jPCT-AE(13394): OpenGL vendor:     Marvell Technology Group Ltd
07-19 13:17:58.250: I/jPCT-AE(13394): OpenGL renderer:   GC530 Graphics Engine
07-19 13:17:58.250: I/jPCT-AE(13394): OpenGL version:    OpenGL ES-CM 1.1
07-19 13:17:58.250: I/jPCT-AE(13394): OpenGL renderer initialized (using 4 texture stages)
07-19 13:18:02.320: I/jPCT-AE(13394): Remapping 781 vertex indices!
07-19 13:18:02.320: I/jPCT-AE(13394): Creating vertex cache (18744 bytes)!
07-19 13:18:02.359: I/jPCT-AE(13394): Vertex indices will be accessed directly!
07-19 13:18:02.367: I/jPCT-AE(13394): Subobject of object 19/object21 compiled to indexed fixed point data using 2712 vertices in 3114ms!
07-19 13:18:02.367: I/jPCT-AE(13394): Object 19/object21 compiled to 1 subobjects in 4097ms!
07-19 13:18:02.820: I/jPCT-AE(13394): Remapping 61 vertex indices!
07-19 13:18:02.820: I/jPCT-AE(13394): Creating vertex cache (1464 bytes)!
07-19 13:18:02.828: I/jPCT-AE(13394): Vertex indices will be accessed directly!
07-19 13:18:02.828: I/jPCT-AE(13394): Subobject of object 20/object22 compiled to indexed fixed point data using 312 vertices in 344ms!
07-19 13:18:02.828: I/jPCT-AE(13394): Object 20/object22 compiled to 1 subobjects in 457ms!
07-19 13:18:02.945: D/dalvikvm(13394): GC_EXTERNAL_ALLOC freed 257K, 18% free 19485K/23495K, external 3044K/3668K, paused 107ms
07-19 13:18:03.046: D/dalvikvm(13394): GC_FOR_MALLOC freed 3K, 18% free 19482K/23495K, external 3872K/4836K, paused 85ms
07-19 13:18:03.054: I/dalvikvm-heap(13394): Grow heap (frag case) to 26.175MB for 1048592-byte allocation
07-19 13:18:03.179: D/dalvikvm(13394): GC_FOR_MALLOC freed 4K, 17% free 20502K/24583K, external 3821K/4772K, paused 87ms


kiffa

Oh, i hava found the reason: 

I used a debug-version-apk, it run slow. If i use release version, then run fast.

raft

I guess you mean debugging in Eclipse is slow compared to running in Eclipse?

kiffa

With the same eclipse project:

Slow situation:
  Connect a phone to (PC)Eclipse, and press Eclipse's debug-button, then the Android-ADT will install the apk on the phone, and run it    ------  run very slow.

Fast situation:
  Export apk from eclipse,  then install the apk on phone ----------  run fast.

Strange?  May be this only happend to me.... :-\

raft

no, it's not only you and it's not directly related to Bones. debugging Android makes things slow, unfortunately :(

Quote from: kiffa
Fast situation:
  Export apk from eclipse,  then install the apk on phone ----------  run fast.
you can also run the program directly instead of first exporting to APK and installing it. select in menu or press button or whatever and select run instead of debug.

kiffa

Thanks, i will refer to google's DOC to know the difference between "debug" and "run".