SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
ANdroid
A few Benchmarks
Alberto Mancini - Francesca Tosi
15 Aprile 2014
HTML5Dev
alberto@jooink.com
http://github.com/jooink
http://www.jooink.com
http://jooink.blogspot.com
Itjustwasn'tready
Si riferiva a FB su mobile che era web based e stava facendo la prima intervista
“After the company’s continuous stock price drop” (ndr)
http://mashable.com/2012/09/11/mark-zuckerberg-post-ipo-interview/
fastbook
http://www.sencha.com/blog/the-making-of-fastbook-an-html5-love-story
fastbook, Sencha’s fb demo client
"... is really promising, but it is running in the “browser”.
When you make an “installable” app, you can only use WebView,
which is a second-class and slower browser."
It's a technology demo that shows what developers can do with HTML5 if they take the
right approach, and use the right frameworks and tools
(*)WebApps ● cached
● offline capable
● mobile-webapp-capable
● Homescreen-installed
● hosted app
● packaged app
https://developers.google.com/chrome/apps/
https://developer.mozilla.org/en-US/Apps/Build/installable_apps
secondo alcuni sono una liberazione dai marketplace (i.e. Google Play & AppStore)
secondo alcuni tra l’altro alcune tecnologie vengono ritardate dai produttori per non
perdere il potere che viene dai marketplace
GWT/MGWT Java to Javascript compiler
Emulated JRE
Widgets
Deferred Binding
Multiple Browsers
Compiled Resources
...
xché
una codebase e
tante 'incarnazioni'
dell'applicazione.
MarkerBasedAR
http://code.google.com/p/gwt-webgl/
http://code.google.com/p/gwt-nyartoolkit/
http://picshare.jooink.com
c.a. 25 fps
GWT-Boofcv GWT-Boofcv sample at:
http://goo.gl/3IJQgs
GWT-Boofcv GWT-Boofcv sample at:
http://goo.gl/3IJQgs
strategy
● native ?
● hybrid ?
● browser-based ?
Native,NDK
capire quanto possiamo guadagnare in
termini di performance basandoci su
differenti tecnologie
Applicazione
Android NDK
che usa
librerie native
Applicazione
Android Java
per Dalvik
Benchmarks
il medesimo algoritmo implementato con tecnologie
diverse eseguito sul medesimo dispositivo
Benchmark
In entrambe le applicazioni precedenti una
operazione semplice ma computazionalmente costosa
è fare la conversione in grayscale delle immagini
Rules RGB
jbyte[1024*1024*3]
Average on 1000 runs
gray
jbyte[1024*1024]
1
0.299*R+0.587*G+0.114*B → Y
2
3
Testdevice Galaxy Tab3
Intel Atom CPU Z2560
2 core - 1.60 GHz
Android 4.4.2
Architettura i686
Competitors Benchmarks on:
Java <byte>
NDK <jbyte>
IPP <Ipp8u>
Competitors Benchmarks on:
Java <byte>
NDK <jbyte>
IPP <Ipp8u>
Intel Integrated Performance Primitives
Competitors Benchmarks on:
Java <byte>
NDK <jbyte>
IPP <Ipp8u>
Chrome <Uint8Array>
Firefox <Uint8Array>
Aurora <Uint8Array>
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]);
}
Using FP arithmetics !!
We cannot (at least without asm.js) coherce
numbers to integers in js so we chosen not to
optimize here.
Details(NDK)
https://developer.android.com/tools/sdk/ndk/index.html
La documentazione non e’ il punto di forza dell’
NDK
https://github.com/jooink/ndk-cpuid
● start the (intel) avd
● enter in the jni folder & execute 'ndk-build'
● from the CPUIDApp root dir execute 'ant debug'
● adb install -r bin/CPUIdApp-debug.apk
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);
...
}
Details(IPP) Bundled in BeaconMountain beh … la ‘preview’
http://software.intel.com/en-us/intel-ipp
… ed avete la IPP per android x86 !!!
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)
Codice(IPP)
… jni ...
IppiSize srcRoi = { 1024, 1024 };
Ipp8u* pSrc = body_in;
Ipp8u* pDst = body_out;
ippiRGBToGray_8u_C3C1R(pSrc ,1024, pDst, 1024, srcRoi);
… jni ...
Resultsnative
Resultsnative
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 * 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);
Resultsjs
min
max
avg
Grazie Francesca Tosi
francesca@jooink.com
Alberto Mancini
alberto@jooink.com
Github: github.com/jooink/
www.jooink.com
jooink.blogspot.com
Details(HAXM) Bundled in BeaconMountain
http://software.intel.com/en-us/android/articles/intel-hardware-
accelerated-execution-manager
cambia la vita con le immagini x86
Attenzione pianta OSX, maverick
installare lo hotfix

Mais conteúdo relacionado

Semelhante a Alberto Mancini - A few benchmark on Android

Philip Shurpik "Architecting React Native app"
Philip Shurpik "Architecting React Native app"Philip Shurpik "Architecting React Native app"
Philip Shurpik "Architecting React Native app"
Fwdays
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
Francesca Tosi
 
Android 3D by Ivan Trajkovic and Dotti Colvin
Android 3D by Ivan Trajkovic and Dotti ColvinAndroid 3D by Ivan Trajkovic and Dotti Colvin
Android 3D by Ivan Trajkovic and Dotti Colvin
swengineers
 

Semelhante a Alberto Mancini - A few benchmark on Android (20)

(Js) Export your own WebGL Viewer
(Js) Export your own WebGL Viewer(Js) Export your own WebGL Viewer
(Js) Export your own WebGL Viewer
 
Philip Shurpik "Architecting React Native app"
Philip Shurpik "Architecting React Native app"Philip Shurpik "Architecting React Native app"
Philip Shurpik "Architecting React Native app"
 
Go native benchmark test su dispositivi x86: java, ndk, ipp e tbb
Go native  benchmark test su dispositivi x86: java, ndk, ipp e tbbGo native  benchmark test su dispositivi x86: java, ndk, ipp e tbb
Go native benchmark test su dispositivi x86: java, ndk, ipp e tbb
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
 
Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)
 
4Developers 2015: People don't give a f**k of JavaScript - Aurelio De Rosa
4Developers 2015: People don't give a f**k of JavaScript - Aurelio De Rosa4Developers 2015: People don't give a f**k of JavaScript - Aurelio De Rosa
4Developers 2015: People don't give a f**k of JavaScript - Aurelio De Rosa
 
Android Things Getting Started
Android Things Getting StartedAndroid Things Getting Started
Android Things Getting Started
 
IRJET- IOT Dune Buggy –Control it from Anywhere
IRJET- IOT Dune Buggy –Control it from AnywhereIRJET- IOT Dune Buggy –Control it from Anywhere
IRJET- IOT Dune Buggy –Control it from Anywhere
 
IRJET- IOT Dune Buggy –Control it from Anywhere
IRJET-  	  IOT Dune Buggy –Control it from AnywhereIRJET-  	  IOT Dune Buggy –Control it from Anywhere
IRJET- IOT Dune Buggy –Control it from Anywhere
 
Programming objects with android
Programming objects with androidProgramming objects with android
Programming objects with android
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
 
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for starters
 
Myths of Angular 2: What Angular Really Is
Myths of Angular 2: What Angular Really IsMyths of Angular 2: What Angular Really Is
Myths of Angular 2: What Angular Really Is
 
GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)
 
Android 3D by Ivan Trajkovic and Dotti Colvin
Android 3D by Ivan Trajkovic and Dotti ColvinAndroid 3D by Ivan Trajkovic and Dotti Colvin
Android 3D by Ivan Trajkovic and Dotti Colvin
 
IoT Development from Software Developer Perspective
IoT Development from Software Developer PerspectiveIoT Development from Software Developer Perspective
IoT Development from Software Developer Perspective
 
Bitrise: How to make iOS builds faster - Tokyo 2019 March - Eureka meetup
Bitrise: How to make iOS builds faster - Tokyo 2019 March - Eureka meetupBitrise: How to make iOS builds faster - Tokyo 2019 March - Eureka meetup
Bitrise: How to make iOS builds faster - Tokyo 2019 March - Eureka meetup
 
Devraj_Nataraj_CV_PDF
Devraj_Nataraj_CV_PDFDevraj_Nataraj_CV_PDF
Devraj_Nataraj_CV_PDF
 

Último

Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
amilabibi1
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
David Celestin
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Hung Le
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
ZurliaSoop
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
Kayode Fayemi
 

Último (17)

Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
 
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait Cityin kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Zone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptxZone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptx
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
Introduction to Artificial intelligence.
Introduction to Artificial intelligence.Introduction to Artificial intelligence.
Introduction to Artificial intelligence.
 

Alberto Mancini - A few benchmark on Android