Some Sample Performance Numbers

To illustrate some of our ideas, here is a table listing the approximate run times for a few basic actions. Note that these values should NOT be taken as absolute numbers: they are a combination of CPU and wall clock time, and will change as improvements are made to the system. However, it is worth noting how these values apply relative to each other — for example, adding a member variable currently takes about four times as long as adding a local variable.

Action

Time

Add a local variable

1

Add a member variable

4

Call String.lengthO

5

Call empty static native method

5

Call empty static method

12

Call empty virtual method

12.5

Call empty interface method

15

Call Iterator:next() on a HashMap

165

Call put() on a HashMap

600

Inflate 1 View from XML

22,000

Inflate 1 LinearLayout containing 1 TextView

25,000

Inflate 1 LinearLayout containing 6 View objects

100,000

Inflate 1 LinearLayout containing 6 TextView objects

135,000

Launch an empty activity

3,000,000

0 0

Post a comment