Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Development/490171"

(Adding page template)
 
 
Line 3: Line 3:
  
 
Using MethodHandle (from java.lang.invoke/JSR-292) instead of java.lang.reflect.Method/Field can improve performance.
 
Using MethodHandle (from java.lang.invoke/JSR-292) instead of java.lang.reflect.Method/Field can improve performance.
We should evaluate whether it would make sense to adopt new approach.
+
We should adopt new approach wherever it makes sense to do so in code.
  
 
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=490171 ER 490171]
 
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=490171 ER 490171]
Line 14: Line 14:
 
! Version Description & Notes
 
! Version Description & Notes
 
|-  
 
|-  
|  
+
| 22/03/2016
|  
+
| Petros Splinakis
|  
+
| Document creation
 
|}
 
|}
  
 
== Project overview ==
 
== Project overview ==
  
Overview of the project/feature. Why is it desired, what are its goals.
+
Using MethodHandle (from java.lang.invoke/JSR-292) instead of java.lang.reflect.Method/Field can improve performance.
  
 
Goals:
 
Goals:
* goal 1
+
* Use MethodHandle instead of reflection wherever it makes sense to do so (MethodHandle can be cached for multiple calls)
* goal 2
+
  
 
== Concepts ==
 
== Concepts ==
  
Present any concepts relevant to the feature.
+
Caching MethodHandle objects and reusing them results in better performance than using cached Field/Method objects.
  
 
== Requirements ==
 
== Requirements ==
Line 36: Line 35:
  
 
== Design Constraints ==
 
== Design Constraints ==
 +
 +
It does not make sense to use MethodHandle if reuse is not expected, as the overhead of creating it is bigger than using reflection.
  
 
== Design / Functionality ==
 
== Design / Functionality ==
  
 
== Testing ==
 
== Testing ==
 +
 +
Performance tests need to be added to demonstrate that usage of MethodHandle has resulted in performance improvement.
  
 
== API ==
 
== API ==
 +
 +
No API change is expected, this change should be kept internal to EclipseLink code.
  
 
== GUI ==
 
== GUI ==
 +
 +
N/A
  
 
== Config files ==
 
== Config files ==
 +
 +
A configuration option should be considered to be added to toggle between the different implementation approaches.
  
 
== Documentation ==
 
== Documentation ==
 +
 +
MethodHandle evaluation test execution results: [https://wiki.eclipse.org/images/1/18/MethodHandleTest.txt.zip MethodHandleTest.txt.zip]
  
 
== Open Issues ==
 
== Open Issues ==

Latest revision as of 11:07, 22 March 2016

Design Specification: Evaluate if MethodHandle use would result in performance improvement

Using MethodHandle (from java.lang.invoke/JSR-292) instead of java.lang.reflect.Method/Field can improve performance. We should adopt new approach wherever it makes sense to do so in code.

ER 490171

Document History

Date Author Version Description & Notes
22/03/2016 Petros Splinakis Document creation

Project overview

Using MethodHandle (from java.lang.invoke/JSR-292) instead of java.lang.reflect.Method/Field can improve performance.

Goals:

  • Use MethodHandle instead of reflection wherever it makes sense to do so (MethodHandle can be cached for multiple calls)

Concepts

Caching MethodHandle objects and reusing them results in better performance than using cached Field/Method objects.

Requirements

The following sections will expand the goals of this project into more concrete requirements.

Design Constraints

It does not make sense to use MethodHandle if reuse is not expected, as the overhead of creating it is bigger than using reflection.

Design / Functionality

Testing

Performance tests need to be added to demonstrate that usage of MethodHandle has resulted in performance improvement.

API

No API change is expected, this change should be kept internal to EclipseLink code.

GUI

N/A

Config files

A configuration option should be considered to be added to toggle between the different implementation approaches.

Documentation

MethodHandle evaluation test execution results: MethodHandleTest.txt.zip

Open Issues

This section lists the open issues that are still pending that must be decided prior to fully implementing this project's requirements.

Issue # Owner Description / Notes

Decisions

This section lists decisions made. These are intended to document the resolution of open issues or constraints added to the project that are important.

Issue # Description / Notes Decision

Future Considerations

During the research for this project the following items were identified as out of scope but are captured here as potential future enhancements. If agreed upon during the review process these should be logged in the bug system.

Back to the top