SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
Tue-4-Mar, 11:15am, Khasim Syed Mohammed
LCA14-205: Optimizing SQLite for
Android mobile
www.linaro.org
Boot Time Reduction investigation
Back ground of this work
FutureQ1 Q22013
2014
12-DEC-2013
Android Optimizations
Cortex-A7/A15 Investigation
Q3 Q4
Power Optimization investigation
fdlibm
sqlite
Migrate AOSP to latest
zlib
guava
LLVM / Clang Android
explore libart
system start-up
A7/A15 Optimized
bionic
LLVM wrapper
LLVM patches
profile and benchmark
LLVM and GCC
NEON MM libraries
Open Crypto
libraries
Optimize
Speech comp
compiler-rt
Q4
Closed
Development
Drafting
Community/
External
Upstream
Approved
Scheduled
Ongoing
www.linaro.org
Agenda
Progress update
■ What’s the approach
■ Our findings so far
■ Remaining work
NOTE : This is still a work in progress - estimated date of
closure end of April 2014
www.linaro.org
What is SQLite ?
■ SQLite is a software library that implements a self-
contained, serverless, zero-configuration,transactional
SQL database engine.
■ SQLite is the most widely deployed SQL database engine
in the world.
■ The source code for SQLite and more information
available on sqlite.org
www.linaro.org
Do we really need database
in
Mobile devices ?
Do we need database in Mobile device ?
Source : http://gigaom.com/2013/05/11/welcome-to-the-new-and-fast-growing-ecosystem-of-mobile-business-apps/
- Mobile apps are
transforming the
business software
market
- Business / Enterprise
apps are getting built
for “mobile first”
- Most of these
applications need data
base management
system on mobile
-basic requirement:
Large/Small amount of
data should be stored
and important data
should be retrieved
from a large database
in the least possible
time.
• Explore the folder external/sqlite in Android sources
• Finding possible ways of improving the overall
performance of SQlite
• Ensure that we don’t break any compatibility
Expectation
• Understand how SQLite operates and find it’s
dependencies.
Our approach
Commands
Use CPU to
run Queries
eMMC access to
store or retrieve
information
• Possible optimizations areas :
• Data : Improve data throughput
• CPU : Utilize CPU efficiently to run queries faster
and reduce CPU utilization by offloading the SQL
queries to other cores if possible.
• RL Benchmark is an SQLite benchmark that
runs thousands of insert, select, update, and
delete functions - the same functions Android
uses to store data.
• The resulting number is the total amount of
time (in seconds) that it took for your device
to run through all the tests.
• The faster it completed it, the faster your
device stores and retrieves data; thus, lower
is better.
Tools / Measurement
Also looked at SQL Bench, Andro Bench,
but this one was most widely used by app
developers.
• The following functions from cortex-strings optimizations from Linaro perform better than
AOSP
• strlen
• memchr
• memcpy
Learnings
Test with out optimization with optimization
500000000 * strlen(15*a) 8.563289 7.3658144
1000000 * strlen(15000*a) 4.795874 4.4586328
10000000 * memcpy of 15000 bytes 14.0750624 12.276912
900000000 * memcpy of 15 bytes 3.1883678 3.1854456
https://wiki.linaro.
org/Platform/Android/CortexStringsInBionic
Thanks to Bero @ Linaro.org
NOTE: SQLite source has around
a. 240 “memcpy”
b. 60 “strlen”
• Accelerating SQL Database Operations on a GPU is possible (Example with
CUDA) - Thanks to Tom Gall @ Linaro.org for sharing the information
• http://pbbakkum.com/db/
• Nexus 10 device can be prevented from suspending or entering lower power
modes by
echo benchmark >/sys/power/wake_lock
cd /sys/devices/system/cpu/cpu0/cpufreq
echo userspace >scaling_governor
echo 1700000 >scaling_max_freq
echo 1700000 >scaling_min_freq
echo 1700000 >scaling_setspeed
• From 4.3 onwards Android supports FSTRIM, that basically calls DISCARD
command - This marks all the unused blocks on the underlying flash device as
unused, so the device performs better.
Learnings
• On Nexus 10 with AOSP master + Linaro patches for
BIONIC optimizations
• Preventing the device to enter lower power states
Performance improved by 15 %
Observation
BIONIC (memcpy, strlen) optimizations
Test AOSP
4.4.2
Master +
BIONIC
optimizations
Master + BIONIC
optimization + suspend
disabled
1000 INSERTs 8.3 7.328 7.027
25000 INSERTs in a transaction 2.1 2.026 1.997
25000 INSERTs into an indexed
table
2.5 2.012 1.957
100 SELECTs without an index 0.042 0.012 0.008
100 SELECTs on a string
comparison
0.012 0.008 0.015
Creating an index 0.428 0.305 0.312
5000 SELECTs with an index 0.718 0.556 0.515
1000 UPDATEs without an index 2.38 2.138 2.068
BIONIC (memcpy, strlen) optimizations
Test AOSP
4.4.2
Master +
BIONIC
optimizatio
ns
Master + BIONIC
optimization + suspend
disabled
25000 UPDATEs with an index 3.144 3.197 2.965
INSERTs from a SELECT 0.58 0.635 0.552
DELETE without an index 0.63 0.509 0.509
DELETE with an index 0.5 0.468 0.48
DROP TABLE 0.29 0.309 0.292
OVER ALL 21.747 19.503 18.697
• On Nexus 7 with AOSP master
• Enabling ART instead of Dalvik
Performance improved by 11 % (surprising ? despite
SQLite is a native library, the Java API imposes an
significant overhead)
HOWEVER, for some reason ART on Nexus 10 failed to
give any better performance - maybe ART on Nexus 10 is
still not optimized efficiently
Observation
Lib ART (Nexus 7)
Test Dalvik ART
1000 INSERTs 10.594 10.369
25000 INSERTs in a transaction 3.96 3.36
25000 INSERTs into an indexed table 3.93 3.336
100 SELECTs without an index 0.026 0.016
100 SELECTs on a string comparison 0.029 0.016
Creating an index 0.602 0.566
5000 SELECTs with an index 1.222 0.81
1000 UPDATEs without an index 4.357 3.648
Lib ART (Nexus 7)
Test Dalvik ART
25000 UPDATEs with an index 6.079 5.038
INSERTs from a SELECT 0.935 0.96
DELETE without an index 0.886 0.915
DELETE with an index 0.776 0.809
DROP TABLE 0.462 0.433
OVER ALL 33.867 30.279
● Android uses 3.7.11 and SQLite.org is on 3.8.3.1
○ Lot of bug fixes and optimizations - trying since yesterday …
○ Will file a AOSP bug once we try it out to migrate SQLite in AOSP to latest.
● libsql depends on following libraries - need to find if we could optimize any of
these routines.
○ libdl.so
○ liblog.so
○ libicuuc.so
○ libicui18n.so
○ libutils.so
○ libc.so
○ libstdc++.so
○ libm.so
● Android provides many APIs and FLAGS for APP developers like WRITE_AHEAD
(basically buffers multiple I/O access into one and reads/writes in one chunk)
○ Many books, tutorials available to app developers to refer to.
Next steps
• Accelerating SQL Database Operations on a GPU - Should we explore this ?
• The research paper uses CUDA
• Linaro GWG team has a card to implement the same with OpenCL
• Android supports only renderscript (not compatible with OpenCL or CUDA)
• Renderscript is mainly used in JAVA layers to leverage hardware
optimizations, but SQL code is already a “C” code, introducing renderscript
calls is something we haven’t done before.
• Is this worth of an effort ? DEBATE …
• May be wait till we get some numbers to compare with OpenCL.
Next steps - “Need a new slide for this one”
Please feel free to mail us on
linaro-android@lists.linaro.org
or IRC (freenode)
#linaro-android
Any questions ?
More about Linaro Connect: http://connect.linaro.org
More about Linaro: http://www.linaro.org/about/
More about Linaro engineering: http://www.linaro.org/engineering/
Linaro members: www.linaro.org/members

Más contenido relacionado

Similar a LCA14: LCA14-205: Optimizing SQLite for Android mobile

Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015Mirco Hering
 
OpenStack Integration with OpenContrail and OpenDaylight
OpenStack Integration with OpenContrail and OpenDaylightOpenStack Integration with OpenContrail and OpenDaylight
OpenStack Integration with OpenContrail and OpenDaylightSyed Moneeb
 
SCM Transformation Challenges and How to Overcome Them
SCM Transformation Challenges and How to Overcome ThemSCM Transformation Challenges and How to Overcome Them
SCM Transformation Challenges and How to Overcome ThemCompuware
 
OAP: Optimized Analytics Package for Spark Platform with Daoyuan Wang and Yua...
OAP: Optimized Analytics Package for Spark Platform with Daoyuan Wang and Yua...OAP: Optimized Analytics Package for Spark Platform with Daoyuan Wang and Yua...
OAP: Optimized Analytics Package for Spark Platform with Daoyuan Wang and Yua...Databricks
 
Exploring mysql cluster 7.4
Exploring mysql cluster 7.4Exploring mysql cluster 7.4
Exploring mysql cluster 7.4Ivan Ma
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalNAVER D2
 
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Databricks
 
Using Compuware Strobe to Save CPU: 4 Real-life Cases from the Files of CPT G...
Using Compuware Strobe to Save CPU: 4 Real-life Cases from the Files of CPT G...Using Compuware Strobe to Save CPU: 4 Real-life Cases from the Files of CPT G...
Using Compuware Strobe to Save CPU: 4 Real-life Cases from the Files of CPT G...Compuware
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixC4Media
 
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...Codemotion
 
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...Demi Ben-Ari
 
LCA14: LCA14-403: Importance of migrating external projects used in Android t...
LCA14: LCA14-403: Importance of migrating external projects used in Android t...LCA14: LCA14-403: Importance of migrating external projects used in Android t...
LCA14: LCA14-403: Importance of migrating external projects used in Android t...Linaro
 
Oracle Analytics Server Infrastructure Tuning guide v2.pdf
Oracle Analytics Server Infrastructure Tuning guide v2.pdfOracle Analytics Server Infrastructure Tuning guide v2.pdf
Oracle Analytics Server Infrastructure Tuning guide v2.pdfsivakodali7
 
Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android BenchmarksKoan-Sin Tan
 
Oracle applications r12.2, ebr, online patching means lot of work for devel...
Oracle applications r12.2, ebr, online patching   means lot of work for devel...Oracle applications r12.2, ebr, online patching   means lot of work for devel...
Oracle applications r12.2, ebr, online patching means lot of work for devel...Ajith Narayanan
 
InteropWG Intro & Vertical Programs (May. 2017)
InteropWG Intro & Vertical Programs (May. 2017)InteropWG Intro & Vertical Programs (May. 2017)
InteropWG Intro & Vertical Programs (May. 2017)Mark Voelker
 
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptxCON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptxSergioBruno21
 

Similar a LCA14: LCA14-205: Optimizing SQLite for Android mobile (20)

Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015
 
OpenStack Integration with OpenContrail and OpenDaylight
OpenStack Integration with OpenContrail and OpenDaylightOpenStack Integration with OpenContrail and OpenDaylight
OpenStack Integration with OpenContrail and OpenDaylight
 
SCM Transformation Challenges and How to Overcome Them
SCM Transformation Challenges and How to Overcome ThemSCM Transformation Challenges and How to Overcome Them
SCM Transformation Challenges and How to Overcome Them
 
OAP: Optimized Analytics Package for Spark Platform with Daoyuan Wang and Yua...
OAP: Optimized Analytics Package for Spark Platform with Daoyuan Wang and Yua...OAP: Optimized Analytics Package for Spark Platform with Daoyuan Wang and Yua...
OAP: Optimized Analytics Package for Spark Platform with Daoyuan Wang and Yua...
 
Exploring mysql cluster 7.4
Exploring mysql cluster 7.4Exploring mysql cluster 7.4
Exploring mysql cluster 7.4
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
 
Using Compuware Strobe to Save CPU: 4 Real-life Cases from the Files of CPT G...
Using Compuware Strobe to Save CPU: 4 Real-life Cases from the Files of CPT G...Using Compuware Strobe to Save CPU: 4 Real-life Cases from the Files of CPT G...
Using Compuware Strobe to Save CPU: 4 Real-life Cases from the Files of CPT G...
 
SQL Tuning 101
SQL Tuning 101SQL Tuning 101
SQL Tuning 101
 
sqltuning101-170419021007-2.pdf
sqltuning101-170419021007-2.pdfsqltuning101-170419021007-2.pdf
sqltuning101-170419021007-2.pdf
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
 
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
 
LCA14: LCA14-403: Importance of migrating external projects used in Android t...
LCA14: LCA14-403: Importance of migrating external projects used in Android t...LCA14: LCA14-403: Importance of migrating external projects used in Android t...
LCA14: LCA14-403: Importance of migrating external projects used in Android t...
 
Oracle Analytics Server Infrastructure Tuning guide v2.pdf
Oracle Analytics Server Infrastructure Tuning guide v2.pdfOracle Analytics Server Infrastructure Tuning guide v2.pdf
Oracle Analytics Server Infrastructure Tuning guide v2.pdf
 
Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android Benchmarks
 
Oracle applications r12.2, ebr, online patching means lot of work for devel...
Oracle applications r12.2, ebr, online patching   means lot of work for devel...Oracle applications r12.2, ebr, online patching   means lot of work for devel...
Oracle applications r12.2, ebr, online patching means lot of work for devel...
 
Callgraph analysis
Callgraph analysisCallgraph analysis
Callgraph analysis
 
InteropWG Intro & Vertical Programs (May. 2017)
InteropWG Intro & Vertical Programs (May. 2017)InteropWG Intro & Vertical Programs (May. 2017)
InteropWG Intro & Vertical Programs (May. 2017)
 
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptxCON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
 

Más de Linaro

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloLinaro
 
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaLinaro
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraLinaro
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaLinaro
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018Linaro
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018Linaro
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...Linaro
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Linaro
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Linaro
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteLinaro
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopLinaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allLinaro
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorLinaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMULinaro
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MLinaro
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation Linaro
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootLinaro
 

Más de Linaro (20)

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
 
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qa
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening Keynote
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8M
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 

Último

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

LCA14: LCA14-205: Optimizing SQLite for Android mobile

  • 1. Tue-4-Mar, 11:15am, Khasim Syed Mohammed LCA14-205: Optimizing SQLite for Android mobile
  • 2. www.linaro.org Boot Time Reduction investigation Back ground of this work FutureQ1 Q22013 2014 12-DEC-2013 Android Optimizations Cortex-A7/A15 Investigation Q3 Q4 Power Optimization investigation fdlibm sqlite Migrate AOSP to latest zlib guava LLVM / Clang Android explore libart system start-up A7/A15 Optimized bionic LLVM wrapper LLVM patches profile and benchmark LLVM and GCC NEON MM libraries Open Crypto libraries Optimize Speech comp compiler-rt Q4 Closed Development Drafting Community/ External Upstream Approved Scheduled Ongoing
  • 3. www.linaro.org Agenda Progress update ■ What’s the approach ■ Our findings so far ■ Remaining work NOTE : This is still a work in progress - estimated date of closure end of April 2014
  • 4. www.linaro.org What is SQLite ? ■ SQLite is a software library that implements a self- contained, serverless, zero-configuration,transactional SQL database engine. ■ SQLite is the most widely deployed SQL database engine in the world. ■ The source code for SQLite and more information available on sqlite.org
  • 5. www.linaro.org Do we really need database in Mobile devices ?
  • 6. Do we need database in Mobile device ? Source : http://gigaom.com/2013/05/11/welcome-to-the-new-and-fast-growing-ecosystem-of-mobile-business-apps/ - Mobile apps are transforming the business software market - Business / Enterprise apps are getting built for “mobile first” - Most of these applications need data base management system on mobile -basic requirement: Large/Small amount of data should be stored and important data should be retrieved from a large database in the least possible time.
  • 7. • Explore the folder external/sqlite in Android sources • Finding possible ways of improving the overall performance of SQlite • Ensure that we don’t break any compatibility Expectation
  • 8. • Understand how SQLite operates and find it’s dependencies. Our approach Commands Use CPU to run Queries eMMC access to store or retrieve information • Possible optimizations areas : • Data : Improve data throughput • CPU : Utilize CPU efficiently to run queries faster and reduce CPU utilization by offloading the SQL queries to other cores if possible.
  • 9. • RL Benchmark is an SQLite benchmark that runs thousands of insert, select, update, and delete functions - the same functions Android uses to store data. • The resulting number is the total amount of time (in seconds) that it took for your device to run through all the tests. • The faster it completed it, the faster your device stores and retrieves data; thus, lower is better. Tools / Measurement Also looked at SQL Bench, Andro Bench, but this one was most widely used by app developers.
  • 10. • The following functions from cortex-strings optimizations from Linaro perform better than AOSP • strlen • memchr • memcpy Learnings Test with out optimization with optimization 500000000 * strlen(15*a) 8.563289 7.3658144 1000000 * strlen(15000*a) 4.795874 4.4586328 10000000 * memcpy of 15000 bytes 14.0750624 12.276912 900000000 * memcpy of 15 bytes 3.1883678 3.1854456 https://wiki.linaro. org/Platform/Android/CortexStringsInBionic Thanks to Bero @ Linaro.org NOTE: SQLite source has around a. 240 “memcpy” b. 60 “strlen”
  • 11. • Accelerating SQL Database Operations on a GPU is possible (Example with CUDA) - Thanks to Tom Gall @ Linaro.org for sharing the information • http://pbbakkum.com/db/ • Nexus 10 device can be prevented from suspending or entering lower power modes by echo benchmark >/sys/power/wake_lock cd /sys/devices/system/cpu/cpu0/cpufreq echo userspace >scaling_governor echo 1700000 >scaling_max_freq echo 1700000 >scaling_min_freq echo 1700000 >scaling_setspeed • From 4.3 onwards Android supports FSTRIM, that basically calls DISCARD command - This marks all the unused blocks on the underlying flash device as unused, so the device performs better. Learnings
  • 12. • On Nexus 10 with AOSP master + Linaro patches for BIONIC optimizations • Preventing the device to enter lower power states Performance improved by 15 % Observation
  • 13. BIONIC (memcpy, strlen) optimizations Test AOSP 4.4.2 Master + BIONIC optimizations Master + BIONIC optimization + suspend disabled 1000 INSERTs 8.3 7.328 7.027 25000 INSERTs in a transaction 2.1 2.026 1.997 25000 INSERTs into an indexed table 2.5 2.012 1.957 100 SELECTs without an index 0.042 0.012 0.008 100 SELECTs on a string comparison 0.012 0.008 0.015 Creating an index 0.428 0.305 0.312 5000 SELECTs with an index 0.718 0.556 0.515 1000 UPDATEs without an index 2.38 2.138 2.068
  • 14. BIONIC (memcpy, strlen) optimizations Test AOSP 4.4.2 Master + BIONIC optimizatio ns Master + BIONIC optimization + suspend disabled 25000 UPDATEs with an index 3.144 3.197 2.965 INSERTs from a SELECT 0.58 0.635 0.552 DELETE without an index 0.63 0.509 0.509 DELETE with an index 0.5 0.468 0.48 DROP TABLE 0.29 0.309 0.292 OVER ALL 21.747 19.503 18.697
  • 15. • On Nexus 7 with AOSP master • Enabling ART instead of Dalvik Performance improved by 11 % (surprising ? despite SQLite is a native library, the Java API imposes an significant overhead) HOWEVER, for some reason ART on Nexus 10 failed to give any better performance - maybe ART on Nexus 10 is still not optimized efficiently Observation
  • 16. Lib ART (Nexus 7) Test Dalvik ART 1000 INSERTs 10.594 10.369 25000 INSERTs in a transaction 3.96 3.36 25000 INSERTs into an indexed table 3.93 3.336 100 SELECTs without an index 0.026 0.016 100 SELECTs on a string comparison 0.029 0.016 Creating an index 0.602 0.566 5000 SELECTs with an index 1.222 0.81 1000 UPDATEs without an index 4.357 3.648
  • 17. Lib ART (Nexus 7) Test Dalvik ART 25000 UPDATEs with an index 6.079 5.038 INSERTs from a SELECT 0.935 0.96 DELETE without an index 0.886 0.915 DELETE with an index 0.776 0.809 DROP TABLE 0.462 0.433 OVER ALL 33.867 30.279
  • 18. ● Android uses 3.7.11 and SQLite.org is on 3.8.3.1 ○ Lot of bug fixes and optimizations - trying since yesterday … ○ Will file a AOSP bug once we try it out to migrate SQLite in AOSP to latest. ● libsql depends on following libraries - need to find if we could optimize any of these routines. ○ libdl.so ○ liblog.so ○ libicuuc.so ○ libicui18n.so ○ libutils.so ○ libc.so ○ libstdc++.so ○ libm.so ● Android provides many APIs and FLAGS for APP developers like WRITE_AHEAD (basically buffers multiple I/O access into one and reads/writes in one chunk) ○ Many books, tutorials available to app developers to refer to. Next steps
  • 19. • Accelerating SQL Database Operations on a GPU - Should we explore this ? • The research paper uses CUDA • Linaro GWG team has a card to implement the same with OpenCL • Android supports only renderscript (not compatible with OpenCL or CUDA) • Renderscript is mainly used in JAVA layers to leverage hardware optimizations, but SQL code is already a “C” code, introducing renderscript calls is something we haven’t done before. • Is this worth of an effort ? DEBATE … • May be wait till we get some numbers to compare with OpenCL. Next steps - “Need a new slide for this one”
  • 20. Please feel free to mail us on linaro-android@lists.linaro.org or IRC (freenode) #linaro-android Any questions ?
  • 21. More about Linaro Connect: http://connect.linaro.org More about Linaro: http://www.linaro.org/about/ More about Linaro engineering: http://www.linaro.org/engineering/ Linaro members: www.linaro.org/members