ART JDWP Performance improvement patches: Is the ART Team interested?

95 views
Skip to first unread message

Gergely Kis

unread,
Jul 14, 2014, 12:46:49 PM7/14/14
to android...@googlegroups.com, Dániel Mihályi
Dear ART Team,

While working on Migeran (http://www.migeran.com) a new Java on iOS solution which is based on the Android runtime, we ran into a few bottlenecks in the ART JDWP implementation. 

A single step over a specific method call took more than 36 (!) minutes (!!) on ARM (iPad Mini) hardware. Granted, that our test case is a corner case, and that this particular method call is doing heavy annotation metadata manipulation and numerous JNI calls, but we did not had the same issue with Dalvik running on the same hardware. 

We profiled the issue, and identified the performance bottlenecks. We developed 3 patches. With these patches we were able to get the time for our 36 minute step over operation down to 2 seconds.

Short description of the patches:

1. Eliminate stack walks from the JDWP frame id computation

2. Do not copy the instrumentation event listener list when delivering instrumentation events

3. Implement on-demand deoptimization during single stepping. 

This last patch probably requires a bit more description:

In the original implementation, when a single step control gets activated, every method gets deoptimized, and all code during the step operation is running in interpreted mode. This results in a huge performance penalty, especially if the method that is being executed calls reflection methods related to annotation processing, which are also implemented in Java. 

In our implementation, only those frames are deoptimized, which need it (e.g. stepped into, or where a breakpoint was placed). Also, frames are automatically undeoptimized, when deoptimization is no longer required.

We have not yet tested our patches on "real" Android platforms, only on iOS (both x86 simulator and ARM hardware), but the patches are architecture independent, and we would be happy to test and submit them to AOSP if the ART team would be interested in reviewing them.

Best Regards,
Gergely  


Kis Gergely
ügyvezető / CEO
MattaKis Consulting
Email: gerge...@mattakis.com
Web: http://www.mattakis.com
Phone: +36 70 408 1723
Fax: +36 27 998 622

enh

unread,
Jul 14, 2014, 12:55:49 PM7/14/14
to android...@googlegroups.com, Dániel Mihályi
yeah, those definitely sound interesting. please upload patches to
AOSP (preferably three separate ones --- it makes review easier and it
makes it easy to get simple fixes in even if it's taking a while to
get a more complicated fix in).

an extra JDWP test in external/apache-harmony/jdwp that demonstrates
the problem is always good to prevent future regressions too!
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-contr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Java i18n/JNI/NIO, or bionic questions? Mail me/drop by/add me as a reviewer.

Gergely Kis

unread,
Jul 14, 2014, 3:28:05 PM7/14/14
to android...@googlegroups.com, Dániel Mihályi
Ok, great. You can expect our patches sometime next week.

Best Regards,
Gergely

Reply all
Reply to author
Forward
0 new messages