18
Evaluating the Impact of Android Best Practices on Energy Consumption By: Sona Mundody Under the Guidance of Mr. Sudarshan .K Asst. Professor (CSE), Srinivas Institute of Technology, Mangalore

Evaluating the Impact of Android Best Practices on Energy Consumption

Embed Size (px)

Citation preview

Evaluating the Impact of Android Best Practices on Energy

Consumption

By:

Sona Mundody Under the Guidance of

Mr. Sudarshan .KAsst. Professor (CSE),

Srinivas Institute of Technology, Mangalore

Contents Introduction

Related Work

Android Best Practices

Methodology

Experimental Results

Conclusion

References

IntroductionSmart phones and tablets are dominant devices in the present

market.

Android platform dominates a large share of smartphone market.

Android provides SDK and set of developer tools.

Problem: Optimization of mobile application is a hard task. Extending battery life is a challenge.

Solution: Best practice for Android development by Google.

Related WorkPaper Abstract Conclusion(s) drawn

“Evaluating Android Best Practices for Performance”-Aline .R..Tonini et al.,2013

Studies and evaluates a subset of Google best practices for performance

Best practices reduce the execution time by a significant amount.

“Performance and Energy Consumption analysis of Embedded Applications based on Android Platform” -Andrews Viera et al.,2012

Analysis of performance and energy consumption of android applications in recursive and iterative algorithmic versions.

Execution time and power dissipation was higher in recursive algorithms compared to iterative algorithms.

“Benchmark Dalvik and Native Code for Android System”- C. M. Lin, et.al., 2011

A complete approach to benchmark Dalvik java code and Native code on real Android device.

The overall performanceassessment of native code is faster than Dalvik Java codeabout 34.2%.

“Android on Mobile Devices : An Energy Perspective”-T.T.Kundu and K.Paul ,2010

Presents comparison between Dalvik Virtual Machine and Sun embedded JVM

Android provides better VM designs but consumes more energy due to lack of dynamic compiler in Dalvik JVM.

Best Practices for Performance Avoid Creating Unnecessary Objects

Prefer Static Over Virtual

Use Static Final For Constants

Avoid Internal Getters/Setters

Use Enhanced For Loop Syntax

Consider Package Instead of Private Access with Private Inner classes

Avoid Using Floating-Point

Methodology

Performance analysis

-Traceview tool

- android.os.Debug library

Energy Consumption estimation

- PowerTutor

Emulator is used for all experiments

-Runs Android 4.2.2 using API 17

-emulates ARM EABI V7a Processor

Test application - OpenSudoku

Fig1:Code for With/Without Getters Fig 2:Code for For Loop analysis

Fig3: Code for tracing With/Without Getters

Fig4: Code for tracing For Loop

Traceview

PowerTutor

Results for Experimental Code

protected boolean validate() {boolean valid=true;Map <Integer, Cell> cellsByValue= new HashMap<Integer, Cell>()

//int len=mCells.length;Cell cell;int value;//for(int i=0; i<len; i++) {for(Cell a:mCells) {

//cell=mCells[i];cell=a;//value=cell.getValue;value=cell.mValue;if(cellsByValue.get(Value) != null){ //mCell[i]=setValid(false); a.mValid= false;} else { cellsByValue.put(value,cell);

} }}

OpenSudoku Application

Fig 5: validate() method after both practices are applied

Results for OpenSudoku Application

Results (Cont…)

TABLE III: PERFORMANCE AND ENERGY RESULSTS FOR WITH/WITHOUT PRACTICES

• Two best practices are evaluated for performance and energy efficiency.

• Experimental code as well as a real application indicate positive impact of these practices.

• Experimental results show that the two practices reduce the energy consumption of the application by 21%

Conclusion

References

[1] Aline Rodrigues Tonini et.al., “ Evaluating Android best practices for performance ” , in South 28 th Microelectronics Symposium, PortoAlegre, 2013.

[2] A. Vieira, D. Debastiani, L. Agostini, F.Marques and J.C.B. Mattos, “Performance and Energy Consumption Analysis of Embedded Applications Based on Android Platform”, in SBESC, Natal, 2012.

[3] C.M. Lin, J.H. Lin, C.R. Dow and C.M.Wen,” Benchmark Dalvik and Native Code for Android System,” in Innovations in Bioinspired Computing and Applications (IBICA), Shenzhan, 2011.

[4] T. T. Kundu and K. Paul, “Android on Mobile Devices: An Energy Perspective”, in Computer and Information Technology (CIT), Bradford, 2010.

References

[7] Google Best Practices, 2014. [Online]

http://developer.android.com/training/articles/perf-tips.html

[8] Android Tracing, 2014. [Online]

http://developer.android.com/tools/debugging/debuggingtracing.html

[9] PowerTutor, 2014. [Online]

http://www.powertutor.org

[10] Open Sudoku , 2014. [Online]

http://code.google.com/p/opensudoku-android/

THANK YOU