Improving application startup time by automatic profiling

Automatic Usage Profiling을 통한 초기 앱 실행 속도 개선 방법

  • Received : 2019.02.27
  • Accepted : 2019.05.08
  • Published : 2019.06.30

Abstract

Google released an initial version of Android that runs Dex(Dalvik Executable) through the Dalvik Runtime. Since Dalvik Runtime is based on interpreter, JIT(Just-in-time) compilation has been applied to improve performance. After Lollipop(Android 5.0) Dalvik Runtime has replaced with ART Runtime which support AOT (Ahead-of-time) compilation of Dex into Native Code. The late st Android has a problem that the application execution speed is slow until the AOT compilation is completed according to the actual usage record after the installation of the app. To improve the problem we have investigate the characteristics of profile that can improve the execution speed of the application and generate the profile automatically. Finally we propose a method that can optimize the application at install time. With the proposed method we can optimize selectively at install time and can help improving the execution speed of the app from the initial execution.

Google은 2009년 Bytecode로 구성된 Dex(Dalvik Executable)를 Dalvik Runtime의 Interpreter가 실행하는 형태의 Android를 공개하였다. 이후로 Interpreter 실행 속도 개선을 위해 JIT(Just-in-time) 컴파일 기술을 적용하였고 Lollipop(Android 5.0)부터는 Dalvik Runtime을 대체하여 ART Runtime을 제공하여 AOT(A head-of-time) 컴파일 지원을 통해 앱 설치 이후부터 Bytecode가 아닌 Native code로 동작하도록 함으로써 성능을 높일 수 있게 되었다. 하지만 앱 설치/업데이트 시점에 모든 대상을 컴파일하는 AOT 컴파일은 시간이 오래 걸리고 메모리/CPU 자원을 많이 사용함에 따라 느려지고 발열을 유발하여 사용자 불편함을 초래하였다. 시간이 지날수록 더 복잡하고 큰 코드를 지닌 앱들이 많이 등 장함에 따라 AOT 컴파일로 인해 발생하는 문제들이 더 많이 발생하게 되었고, Nougat(Android 7.0)부터는 이를 개선하여 AOT 컴파일을 앱 설치/업데이트 시점에 모두 수행하지 않고 최적화 시점을 나중으로 미루고 실제 사용자의 사용 기록인 Profile을 사용하는 Profile-guided 컴파일 방법을 통해 문제를 회피하고 있다. 이 연구에서는 앱 실행 속도를 설치 직후부터 개선할 수 있도록 하기 위해 Profile에 따른 앱 실행 속도의 특성을 파악하여 앱 실행 속도를 개선할 수 있는 Profile을 앱 개발 시점에 자동 생성하는 방법과 자동생성한 프로파일을 APK에 포함하고 앱 설치/업데이트 시점에 활용하여 최적화를 할 수 있는 방법을 제안한다. 제안하는 방법을 통해 앱 설치 시점에 Profile에 기반하여 선택적으로 컴파일할 수 있으므로 설치 시점에 발생하는 사용자 불편을 최소화할 수 있으며 앱 설치 이후 Native code 실행을 통해 앱 실행 속도를 최초 실행부터 개선할 수 있다.

Keywords

References

  1. 백영민, 홍광의, 배두환 : 효과적인 모델 기반 안드로이드 GUI 테스팅을 위한 GUI 상태 비교 기법 , 정보과학회논문지, 42 (11), 2015, 1386-1396