Optimizable patterns
Venkata Sai Surya Prakash Sanagala cs21m071
cs21m071 at smail.iitm.ac.in
Sun Jul 9 19:27:52 UTC 2023
Hi.
I am a graduate student in the Dept of CSE, IIT Madras, India. We are
working on a tool called CCAP (Collection Class Access oPtimization) that
tries to analyze/optimize Java programs that use Java collection class
libraries. The tool works by identifying certain types of patterns of
invocations of collection-class library functions in the Java programs and
then replacing those series of function calls with a single function that
does all the operations of the pattern together, in a more efficient
manner. We have analyzed your project (from GitHub) using our tool. Here
are our findings:
File *src/java.base/share/classes/java/util/stream/Collectors.java* addAll
(Line num:1930), retainAll (Line num:1931) --> replace with
addAll_retainAll (Line num:1931).
File *test/jdk/java/lang/reflect/AccessControl/AccessControlTest.java*
copyOf (267), retainAll (268) --> replace with copyOf_retainAll (268).
Here,
addAll_retainAll method will merge both addAll and retainAll operation into
a single operation so that there is no need to go through elements twice in
the worst case.
copyOf_retainAll method will merge both copyOf and retainAll operation into
a single operation so that there is no need to go through elements in the
copying collection twice.
........................................................................................................
We request you to kindly give us feedback (will take hardly 3-5 minutes)
about our findings. That will be greatly appreciated.
https://forms.gle/RN3ayVS2Xf7EmyHT6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/mobile-dev/attachments/20230710/913eff14/attachment.htm>
More information about the mobile-dev
mailing list