summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_visualizer.cc
diff options
context:
space:
mode:
authorYu Li <yu.l.li@intel.com>2015-06-29 10:50:03 +0800
committerMan Cao <manc@google.com>2015-07-13 15:56:19 -0700
commiteac4424b3420c280f97ff2f815b5dedd8dac9801 (patch)
tree4e7c31b4312aa000bd3d2250df6a05daf61523d7 /compiler/optimizing/graph_visualizer.cc
parentec97825f8553b3a99b6dfbbb90a50fe65301ea94 (diff)
ART: JNI thread state transition optimization
This patch improves the JNI performance by removing the explicit acquiring and releasing the mutator lock when a thread state transits between suspended and runnable states. The functions responsible for changing the state were found to be the costliest part of the JNI. Originally, a thread needs to acquire a shared mutator lock by a CAS instruction when entering the runnable state and also needs to release the lock by a CAS when entering the native state from runnable. This patch removes these CAS operations when a thread state transits between suspended and runnable. A thread in the runnable state is considered to have shared ownership of the mutator lock and therefore transitions in and out of the runnable state have associated implication on the mutator lock ownership. Meanwhile, a barrier is added to control suspending all threads from running. JNI transition overhead was reduced by 25% on IA platform and by 17% on ARM platform by this patch, while it has little impact on GC pause time (measured with "suspend all histogram"). Change-Id: Icee95d8ffff1bbfc95309a41cc48836536fec689 Signed-off-by: Yu, Li <yu.l.li@intel.com> Signed-off-by: Haitao, Feng <haitao.feng@intel.com> Signed-off-by: Lei, Li <lei.l.li@intel.com>
Diffstat (limited to 'compiler/optimizing/graph_visualizer.cc')
0 files changed, 0 insertions, 0 deletions