Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Processing performance in android

I would like to know how are the performances of Processing sketches in Android. Here is the link for more info about Processing-Android : http://wiki.processing.org/w/Android#Instructions

I don't really know at which level lies Processing in Android and how it is implemented. That's why I would like to know what are the performance of a Processing's sketch embedded in an android app in comparison with a normal Canvas of the android API.

Processing let us create relatively easily programs and if the performance were good I'm sure we could save a lot of time drawing certain things of our app with Processing (or at least for a beginner like me, Processing's language seems much more easy than the Java used in android as we can call easily drawing function etc...)

So I would like to have your opinion whereas Processing sketches could be as efficient (in term of performance/optimization) as using Android Java API directly ?

Thanks

like image 649
Jecimi Avatar asked Feb 03 '12 19:02

Jecimi


1 Answers

I've done some tests with the examples given with Processing and I thought it could be useful to some person... So here are the results :

Device : Samsung Galaxy S II : Android 2.3.6, 1GB RAM, Dual-core 1.2 GHz Cortex-A9.

Tests : (on Processing 2.0a4)

  • No = to much lag to do anything (around 5 FPS)
  • Soso = we can see what the sketch is doing but still a lot of lag (around 10/15 FPS)
  • OK = working (around 25 FPS or more)

Basics:

  • Pointillism=OK
  • Sprite=OK
  • ... most of the basic examples are working correctly

Topics:

Interaction:

  • Follow examples =OK

Animation:

  • Sequential=OK

Effects :

  • Unlimited Sprites=OK

Motion:

  • Brownian=OK
  • Bouncy Bubbles=OK

Simulate :

  • Fluid=Soso
  • Flocking =OK (yet sometimes to FPS get a bit lower but acceptable)
  • Simple Particle System=OK
  • Smoke Particle System=OK
  • Spring=OK
  • Multiple Particle Systems=OK
  • Chain=OK

OpenGL:

  • Birds: without PShape3D=Soso, with PShape3D=OK
  • Earth=OK
  • Rocket=OK
  • Extrusion=NO
  • Electric=OK
  • CameraLight=OK
  • YellowTail=OK
  • Planets=OK

Contributed Libraries:

Fisicia:

  • Bubbles=Soso
  • Droppings=Soso
  • Joints=OK
  • Buttons=OK
  • Polygons=OK
  • Restitutions=OK

PBox 2D : couldn't get it working

Some Sketches from OpenProcessing.org

  • http://www.openprocessing.org/visuals/?visualID=3330 = OK
  • http://www.openprocessing.org/visuals/?visualID=1247 = OK
  • http://www.openprocessing.org/visuals/?visualID=8168 = OK
  • http://www.openprocessing.org/visuals/?visualID=5671 = OK
  • http://www.openprocessing.org/visuals/?visualID=10109 = NO
  • http://www.openprocessing.org/visuals/?visualID=7631 =NO
  • http://www.openprocessing.org/visuals/?visualID=7327 = NO

Note: I've run all sketches in their original size, I didn't re-scaled them to fit my SGSII (which has a resolution of 480 x 800) so I guess the performance may vary following the size of the sketch.

Conclusion : Processing is really interesting as a graphic library for android. Most of the example given with Processing are working very well and smoothly on my Phone (including OpenGl examples). Yet it is not as optimized as on PC, indeed simulation like Smoke or Vortex where many particles are involved are really laggy. Fisicia library is working well on android which is a really good point.

Voila :)

like image 162
Jecimi Avatar answered Sep 28 '22 11:09

Jecimi