Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8056751 | emb-9 | Unassigned | P4 | Resolved | Fixed | b24 |
A number of code generation frameworks generate code with thousands of methods. JDI uses a O(all_methods * visible_methods) algorithm to return the list of methods. This can easily be made into a O(all_methods) method by doing the following:
--- a/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java Thu May 01 14:21:29 2014 -0700
+++ b/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java Thu May 08 10:28:23 2014 -0700
@@ -529,7 +529,7 @@
* to filter that ordered collection.
*/
List<Method> list = allMethods();
- list.retainAll(map.values());
+ list.retainAll(new HashSet<Method>(map.values()));
return list;
}
--- a/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java Thu May 01 14:21:29 2014 -0700
+++ b/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java Thu May 08 10:28:23 2014 -0700
@@ -529,7 +529,7 @@
* to filter that ordered collection.
*/
List<Method> list = allMethods();
- list.retainAll(map.values());
+ list.retainAll(new HashSet<Method>(map.values()));
return list;
}
- backported by
-
JDK-8056751 Getting all visible methods in ReferenceTypeImpl is slow
-
- Resolved
-