Getting the Most from Map Data Structures in Android Rubn Saborido , - - PowerPoint PPT Presentation

getting the most from map data structures in android
SMART_READER_LITE
LIVE PREVIEW

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-1
SLIDE 1

Getting the Most from Map Data Structures in Android

Rubén Saborido, Rodrigo Morales Foutse Khomh, Yann-Gaël Guéhéneuc, Giuliano Antoniol

slide-2
SLIDE 2
slide-3
SLIDE 3

What about Android?

slide-4
SLIDE 4

What about Android?

SparseArray if the key is an integer

slide-5
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
SLIDE 6
  • n the usage of maps

How Android developers use maps

100 Android apps from Github

slide-7
SLIDE 7
  • n the usage of maps
slide-8
SLIDE 8
  • n the usage of maps

SparseArray if the key is an integer

slide-9
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
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
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
SLIDE 12

Study about memory

KILOBYTES DATA SIZE

slide-13
SLIDE 13

Study about memory

HashMap 3.76% more than ArrayMap HashMap 54.33% more than SparseArray

slide-14
SLIDE 14

Study about energy

DATA SIZE DATA SIZE JOULES JOULES JOULES DATA SIZE

slide-15
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
SLIDE 16

Study about CPU

MSEC. DATA SIZE DATA SIZE DATA SIZE MSEC. MSEC.

slide-17
SLIDE 17

Study about CPU

HashMap 14.20% faster than ArrayMap HashMap 10.89% faster than SparseArray

slide-18
SLIDE 18

Conclusion

  • ArrayMap instead of HashMap.
  • SparseArray instead of HashMap.
  • Update Android documentation.
  • Warning when ArrayMap is misused.