SLIDE 1
Getting the Most from Map Data Structures in Android Rubn Saborido , - - PowerPoint PPT Presentation
Getting the Most from Map Data Structures in Android Rubn Saborido , - - PowerPoint PPT Presentation
Getting the Most from Map Data Structures in Android Rubn Saborido , Rodrigo Morales Foutse Khomh, Yann-Gal Guhneuc, Giuliano Antoniol What about Android? What about Android? SparseArray if the key is an integer JAVA vs Android 1)
SLIDE 2
SLIDE 3
What about Android?
SLIDE 4
What about Android?
SparseArray if the key is an integer
SLIDE 5
JAVA vs Android
1) Experimental study on the usage of maps. 2) Survey applied to Android developers. 3) Performance of maps. 4) Recommendations.
SLIDE 6
- n the usage of maps
How Android developers use maps
100 Android apps from Github
SLIDE 7
- n the usage of maps
SLIDE 8
- n the usage of maps
SparseArray if the key is an integer
SLIDE 9
to Android developers
- Use of map data structures.
- Familiarity with Android map data structures.
- Developer's profile.
O v e r 5 5
- n
l y 1 2 a n s w e r e d t h e s u r v e y
SLIDE 10
to Android developers
- They prefer HashMap.
- Some of them (55%) know about ArrayMap.
- They know (82%) about SparseArray.
- All of them use Android Studio.
O v e r 5 5
- n
l y 1 2 a n s w e r e d t h e s u r v e y
SLIDE 11
Study about performance
What map data structure is the most efficient
- Memory usage.
- Energy consumption.
- CPU usage.
50 data sizes in (0, 80.000]
SLIDE 12
Study about memory
KILOBYTES DATA SIZE
SLIDE 13
Study about memory
HashMap 3.76% more than ArrayMap HashMap 54.33% more than SparseArray
SLIDE 14
Study about energy
DATA SIZE DATA SIZE JOULES JOULES JOULES DATA SIZE
SLIDE 15
Study about energy
HashMap 2.12%, 1.82%, 0.86% more than ArrayMap HashMap 2.61%, 1.15%, 3.65% more than SparseArray
SLIDE 16
Study about CPU
MSEC. DATA SIZE DATA SIZE DATA SIZE MSEC. MSEC.
SLIDE 17
Study about CPU
HashMap 14.20% faster than ArrayMap HashMap 10.89% faster than SparseArray
SLIDE 18
Conclusion
- ArrayMap instead of HashMap.
- SparseArray instead of HashMap.
- Update Android documentation.
- Warning when ArrayMap is misused.