 |
판매중인 안드로이드폰이 JIT 지원하는지 확인하는 방법[ver 1.0] =============================================================
- 목차 - 1. 요약 2. 세부
1. 요약
이 글은 단지 최근의 안드로이드 버젼에서 JIT가 디폴트로 사용되는지? 안되는지? 에 대한 글입니다. 즉, JIT가 제거되었음을 논의하는 것이 아니며, JIT지원이 추가된 후 최근의 안드로이드 버젼에서 JIT가 기본으로 enable되는지, disable되는지를 논의코자 하는 글이니 얘기하고자 하는 초점에 오해 없기 바랍니다.
자신의 안드로이드 폰이 JIT Compiler가 동작되고 있는지? 동작안되고 있는지? 체크하는 방법에 대해서 간단히 기술합니다.
* JIT를 disable 하는 방법 : /system/build.prop 파일에 아래의 내용이 추가되어 있다면, JIT Compiler Disable되어 있는 겁니다.
1) dalvik.vm.execution-mode=int:fast 라인이 있거나, |
* JIT를 enable 하는 방법 : /system/build.prop 파일에 아래의 내용이 추가되어 있거나,
아무런 내용이 없다면, 여러분의 폰에 JIT Compiler가 Enable 되어 있는 겁니다.
1) dalvik.vm.execution-mode=int:jit 2) dalvik.vm.execution-mode=*** 내용행이 없는 경우 | 위에 처럼 직접 파일을 open해서 확인해도 되고, 또는 간단히, android$> getprop dalvik.vm.execution-mode [enter]을 쳐도 됩니다. 안드로이드 폰에 JIT Compiler가
enable (or disable) 되어 있는제품을 사용하시는 분이 혹시 있으신지
댓글 소통 부탁합니다. 2. 세부 최근에 안드로이드 버젼에서 JIT(Just-In-Time) Compiler가 성능관련 핫이슈로 거론되었었습니다. 아래는 Google I/O 행사에서 발표되었던 Dalvik & JIT에 대한 구글 직원의 발표 동영상입니다.
프로요 버젼에서 JIT Compiler가 성능 개선의 방법으로 제안이 되었다가, 성능관련하여 엇는 잇점대비 잃는 부분들이 더 많은것이 주 이유라 할수 있는데 이에 대한 구글의 공식적인 글입니다.
* Performance Myths ( http://developer.android.com/guide/practices/design/performance.html )
Previous versions of this document made various misleading claims. We address some of them here.
On devices without a JIT, it is true that invoking methods via a variable with an exact type rather than an interface is slightly more efficient.
(So, for example, it was cheaper to invoke methods on a HashMap map than a Map map, even though in both cases the map was a HashMap.) It was not the case that this was 2x slower; the actual difference was more like 6% slower. Furthermore, the JIT makes the two effectively indistinguishable.
On devices without a JIT, caching field accesses is about 20% faster than repeatedly accesssing the field. With a JIT, field access costs about the same as local access, so this isn't a worthwhile optimization unless you feel it makes your code easier to read. (This is true of final, static, and static final fields too.)
|
Dalvik JIT : What Makes This Possible? ( http://android-developers.blogspot.com/2010/05/dalvik-jit.html )
To be clear, the differences aren’t always dramatic, nor do they apply uniformly to all applications. Code that is written to run the CPU all-out can now do more in the same amount of time (running faster), and code that is written to be rate-limited can get its work done using less time and less of the CPU (using less battery). On the performance front in particular, we have seen realistic improvements of 2x to 5x for CPU-bound code, compared to the previous version of the Dalvik VM. This is equivalent to about 4x to 10x faster than a more traditional interpreter implementation
| 참고로, GIT컴파일러를 분기시키는 구현은 ./android-ics-4.0.3/dalvik/vm/Init.cpp 파일내의 ProcessOptions()함수에서 처리하고 있습니다.
. . . . . 윗부분 생략 . . . . . 915 if (strcmp(argv[i] + 6, "portable") == 0) <- Desktop 정복을 위한 야망의 문장.ㅡ.ㅡ; 916 gDvm.executionMode = kExecutionModeInterpPortable; 917 else if (strcmp(argv[i] + 6, "fast") == 0) 918 gDvm.executionMode = kExecutionModeInterpFast; 919 #ifdef WITH_JIT 920 else if (strcmp(argv[i] + 6, "jit") == 0) 921 gDvm.executionMode = kExecutionModeJit; 922 #endif 923 else { 924 dvmFprintf(stderr, 925 "Warning: Unrecognized interpreter mode %sn",argv[i]); 926 /* keep going */ 927 } . . . . . 중 간 생 략 . . . . . 1073 1074 /* 1075 * Default execution mode. 1076 * 1077 * This should probably interact with the mterp code somehow, e.g. if 1078 * we know we're using the "desktop" build we should probably be 1079 * using "portable" rather than "fast". 1080 */ 1081 #if defined(WITH_JIT) 1082 gDvm.executionMode = kExecutionModeJit; 1083 #else 1084 gDvm.executionMode = kExecutionModeInterpFast; 1085 #endif 1086
|
JIT 동작을 위해 필요한 바이너리들은 1) /system/bin/dalvikvm 2) /system/lib/libdvm.so 3) /system/lib/libnativehelper.so 로 구성이 되고 있습니다. 따라서, JIT를 위해 재작업이 되었다면 위의 바이너리를 직접 교체해도 된다는 의미입니다. 이상. |
※ 회원등급 레벨 0 이상 읽기가 가능한 게시판입니다.
16
|