Hi Daniel,

Thanks for the response.

You are correct about the pitfalls of using the NDK.

However, the primary reason that I am using the NDK is pretty much the
same as is mentioned in the NDK documentation. That is, legacy code.

Well, not quite, but the thing is that I have two development
branches: for the PC and for the actual Android target. What I am
doing is that since the debugging support is better on the PC, I try
in new features (or algorithm optimizations) on the PC branch, and
then on the Android branch. What the NDK helps me to do is to
essentially use the same source for the Android branch. I do this by
restricting myself to the headers for which support is stable (libc,
math, etc. as documented by Google) and using #define switches for X86
and ARM code.

So your point is well taken, but using the NDK is helping me cut down
on development time.

About the operations, the operations are basically filtering kind of
operations. But my guess is that the processor stalls are causing the
overall application to drag. Not in terms of responsiveness, as the
computation runs as separate thread (not on the UI thread). But I
would like the results of the processing to be available in a certain
time due to UX constraints.

However, I will check out your suggestion about the Matrix class/
package. Haven't used it before, so I'll check it out.

I will post a follow up on the original thread to include my test
observations... that might help make things more clearer. As to what I
am looking for, and my observations from profiling tests...

Thanks,
Amit


On Aug 19, 7:05 pm, Daniel Drozdzewski <[email protected]>
wrote:
> Amit,
>
> I would avoid using NDK at all cost. It will certainly make your
> project much more complicated and questionably faster.
> There is lot of pain involved with NDK, like making sure it runs on
> all metal out there. You will have choice of compiling for all ARM
> architectures, but without FPU and without THUMB support or compiling
> for beefier ARM processors, but omitting the weak ones, presumably
> having a second build for those. I am also not sure about other
> processors out there. It will certainly become hell in case a popular
> handest comes out with yet different processor architecture in the
> future.
>
> If you haven't yet, please have a look at this 
> article:http://developer.android.com/guide/practices/design/performance.html
>
> What exact transformations are you looking at, btw?
> Quite a lot can be achieved by the use of *android.graphics.Matrix*
> More optimised algorithms are available in the open - there will be
> some Java examples as well. I would start by looking at some graphics
> forums and discussion groups.
>
> Daniel
>
> On 19 Aug, 13:33, Amit <[email protected]> wrote:
>
>
>
>
>
>
>
> > Well yes, I only meant that just the fact of using native code (over
> > Java) won't be very effective. At least that is the impression I have
> > (which may be wrong).
>
> > Considering the fact that even native code ultimately runs inside the
> > Dalvik VM instance, performance gains from use of native code would be
> > modest, right?
>
> > Thanks,
> > Amit
>
> > On Aug 19, 5:03 pm, Fabrizio Giudici <[email protected]>
> > wrote:
>
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
>
> > > On 8/19/10 13:35 , Amit wrote:
>
> > > > Now, I know that native code will *not* yield any significant
> > > > performance improvement over Java code
>
> > > Well, specifically for image processing this won't be true, for sure
> > > up to 2.1 included (as the bytecode is purely interpreted); in 2.2 we
> > > have JIT, but can't speak as I haven't seen it yet.
>
> > > - --
> > > Fabrizio Giudici - Java Architect, Project Manager
> > > Tidalwave s.a.s. - "We make Java work. Everywhere."
> > > java.net/blog/fabriziogiudici -www.tidalwave.it/people
> > > [email protected]
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
> > > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> > > iEYEARECAAYFAkxtHakACgkQeDweFqgUGxe83wCfSDP1NEN+TLD0iOCZ/zSvQDRw
> > > I5cAoJOEoC7eREU5KuPU7m93/GDj9VUr
> > > =2ZDf
> > > -----END PGP SIGNATURE-----

-- 
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

Reply via email to