Intel NDK x86
A few Benchmarks
Francesca Tosi - Alberto Mancini
13 Febbraio 2013
?!?

● Ma che ci fanno
Alberto e
Francesca!??!?!
?!?

● Ma che ci fanno
Alberto e
Francesca!??!?!
● Ma non erano quelli
fissati con le app
web!??!?!
Intel

Francesco Baldassarri
Italian Community Manager
Intel Software and Services Group
email: francescoX.baldassarri@int...
Intel Devices

I devices Intel sono compatibili con l’
ecosistema Android*.
- Android* Dalvik* apps
- These will directly ...
Intel Devices

Intel Investe molto in tool di sviluppo per
Android
- Faster Android Emulator on Intel (Intel HAXM)
- Intel...
Intel Devices

Cosa sta facendo intel per Android
Intel Devices

Intel devices on the market with Intel Inside
Librerie native

3rd party Libraries with x86 support
???

Ma voi due che c’
entrate con le app
native !?!?
NDK

A noi interessa sperimentare la
rapidità/potenzialità della NDK

App NDK

Applicazione
Android
che usa
librerie nativ...
Benchmarks

e testarne le performance

Benchmark
C/Java/Javascript
AR on mobile

Nei lavori che facciamo una
operazione semplice ma costosa
è fare il grayscale sulle immagini

picshare.jooi...
GWT-Boofcv

GWT-Boofcv sample at:
http://goo.gl/3IJQgs
Benchmarks
-
Test arena

Galaxy Tab3
Intel Atom CPU Z2560
2 core - 1.60 GHz
Android 4.4.2
Architettura i686
Rules

1

2

3

RGB
jbyte[1024*1024*3]

gray
jbyte[1024*1024]

0.299*R+0.587*G+0.114*B → Y

Average on 1000 runs
Competitors

Benchmarks on:
Chrome <Uint8Array>
Firefox <Uint8Array>
Aurora <Uint8Array>
Java
<byte>
NDK
<jbyte>
IPP
<Ipp8...
Details (HAXM)

Bundled in BeaconMountain
http://software.intel.com/en-us/android/articles/intel-hardwareaccelerated-execu...
Codice (Java)

Java:
void compute(byte[] in, byte[] out) {
for(int i=0, j=0; i< out.length; i++, j+=3)
out[i] =
(byte)(0.2...
Details (NDK)

https://developer.android.com/tools/sdk/ndk/index.html

La documentazione non e’ il suo forte ...
https://g...
Codice (C, jni)

void JNICALL … jbyteArray in, jbyteArray out) {
jsize len_out = (*env)->GetArrayLength(env, out);
...
jby...
Details (IPP)

Bundled in BeaconMountain

beh … la ‘preview’

http://software.intel.com/en-us/intel-ipp
Scaricate la versi...
Codice (IPP)

… jni ...
IppiSize srcRoi = { 1024, 1024 };
Ipp8u* pSrc = body_in;
Ipp8u* pDst = body_out;
ippiRGBToGray_8u_...
Results native
Results native

min
max
avg
Codice (js)

var len_out = outb.length;
var i,j;
for(i=0, j=0; i< len_out; i++, j+=3)
outb[i] = (0.299 * inb[j] + 0.587 * ...
Results js

min
max
avg
Grazie

Francesca Tosi
francesca@jooink.com
Alberto Mancini

alberto@jooink.com
Github: github.com/jooink/
www.jooink.com
...
Upcoming SlideShare
Loading in...5
×

Intel ndk - a few Benchmarks

798

Published on

Intel NDK - A few Benchmarks

Francesca Tosi, Alberto Mancini - GDG Firenze - Mobile & Embedded

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
798
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Intel ndk - a few Benchmarks

  1. 1. Intel NDK x86 A few Benchmarks Francesca Tosi - Alberto Mancini 13 Febbraio 2013
  2. 2. ?!? ● Ma che ci fanno Alberto e Francesca!??!?!
  3. 3. ?!? ● Ma che ci fanno Alberto e Francesca!??!?! ● Ma non erano quelli fissati con le app web!??!?!
  4. 4. Intel Francesco Baldassarri Italian Community Manager Intel Software and Services Group email: francescoX.baldassarri@intel.com twitter: @francesco_1985 facebook: www.facebook.com/francesco1985 linkedin: it.linkedin.com/in/fbaldassarri/
  5. 5. Intel Devices I devices Intel sono compatibili con l’ ecosistema Android*. - Android* Dalvik* apps - These will directly work, Dalvik has beenoptimized for Intel® platforms. - Android NDK apps - Most will run without any recompilation on consumer platforms. - Android NDK provides an x86 toolchain since 2011 - A simple recompile using the Android NDK yields the best performance - If there is specific processor dependent code, porting may be necessary
  6. 6. Intel Devices Intel Investe molto in tool di sviluppo per Android - Faster Android Emulator on Intel (Intel HAXM) - Intel Threading Building Blocks (TBB) - Intel Graphics Performance Analyzer (GPA) - Intel Integrated Performance Primitives (IPP) - Intel Optimizing Compiler (C++) - Intel Beacon Mountain - Project Anarchy
  7. 7. Intel Devices Cosa sta facendo intel per Android
  8. 8. Intel Devices Intel devices on the market with Intel Inside
  9. 9. Librerie native 3rd party Libraries with x86 support
  10. 10. ??? Ma voi due che c’ entrate con le app native !?!?
  11. 11. NDK A noi interessa sperimentare la rapidità/potenzialità della NDK App NDK Applicazione Android che usa librerie native
  12. 12. Benchmarks e testarne le performance Benchmark C/Java/Javascript
  13. 13. AR on mobile Nei lavori che facciamo una operazione semplice ma costosa è fare il grayscale sulle immagini picshare.jooink.com
  14. 14. GWT-Boofcv GWT-Boofcv sample at: http://goo.gl/3IJQgs
  15. 15. Benchmarks -
  16. 16. Test arena Galaxy Tab3 Intel Atom CPU Z2560 2 core - 1.60 GHz Android 4.4.2 Architettura i686
  17. 17. Rules 1 2 3 RGB jbyte[1024*1024*3] gray jbyte[1024*1024] 0.299*R+0.587*G+0.114*B → Y Average on 1000 runs
  18. 18. Competitors Benchmarks on: Chrome <Uint8Array> Firefox <Uint8Array> Aurora <Uint8Array> Java <byte> NDK <jbyte> IPP <Ipp8u>
  19. 19. Details (HAXM) Bundled in BeaconMountain http://software.intel.com/en-us/android/articles/intel-hardwareaccelerated-execution-manager Attenzione pianta OSX, maverick installare lo hotfix cambia la vita con le immagini x86
  20. 20. Codice (Java) Java: void compute(byte[] in, byte[] out) { for(int i=0, j=0; i< out.length; i++, j+=3) out[i] = (byte)(0.299 * in[j] + 0.587 * in[j+1] + 0.114 * in[j+2]); }
  21. 21. Details (NDK) https://developer.android.com/tools/sdk/ndk/index.html La documentazione non e’ il suo forte ... https://github.com/jooink/ndk-cpuid ● ● ● ● start the (intel) avd (url) enter in the jni folder & execute 'ndk-build' from the CPUIDApp root dir execute 'ant debug' adb install -r bin/CPUIdApp-debug.apk
  22. 22. Codice (C, jni) void JNICALL … jbyteArray in, jbyteArray out) { jsize len_out = (*env)->GetArrayLength(env, out); ... jbyte *body_out = (*env)->GetByteArrayElements(env, out, 0); for(i=0, j=0; i< len_out; i++, j+=3) body_out[i] = (jbyte)(0.299 * body_in[j] + … ); (*env)->ReleaseByteArrayElements(env, in, body_in, 0); ... }
  23. 23. Details (IPP) Bundled in BeaconMountain beh … la ‘preview’ http://software.intel.com/en-us/intel-ipp Scaricate la versione per linux ( la evaluation, or 199$ :( ) Installatela ( vi serve una macchina linux ) Copiate le librerie (*.a) e gli include (*.h) (32bit statici non-threaded) … ed avete la IPP per android x86 !!!
  24. 24. Codice (IPP) … jni ... IppiSize srcRoi = { 1024, 1024 }; Ipp8u* pSrc = body_in; Ipp8u* pDst = body_out; ippiRGBToGray_8u_C3C1R(pSrc ,1024, pDst, 1024, srcRoi); … jni ...
  25. 25. Results native
  26. 26. Results native min max avg
  27. 27. Codice (js) var len_out = outb.length; var i,j; for(i=0, j=0; i< len_out; i++, j+=3) outb[i] = (0.299 * inb[j] + 0.587 * inb[j+1] + 0.114 *inb[j+2]); var buffer_in = new ArrayBuffer(size*3); var buffer_out = new ArrayBuffer(size); var inb = new Uint8Array(buffer_in); var out = new Uint8Array(buffer_out);
  28. 28. Results js min max avg
  29. 29. Grazie Francesca Tosi francesca@jooink.com Alberto Mancini alberto@jooink.com Github: github.com/jooink/ www.jooink.com jooink.blogspot.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×