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