Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create support for caching #8

Open
jonasabreu opened this issue May 29, 2009 · 3 comments
Open

Create support for caching #8

jonasabreu opened this issue May 29, 2009 · 3 comments

Comments

@jonasabreu
Copy link
Member

Reflection can be very expensive. Caching is a good solution.

@jonasabreu
Copy link
Member Author

Postponing to Mirror 2.0.

@garcia-jj
Copy link
Contributor

I don't know if caching reflection is too good. OpenJDK already do some cache optimization in java.lang.Class. As example if you see the method Class.getMethod calls privateGetPublicMethods() that uses ReflectionData that caches reflection info.

So I think that we can get too big improvements adding cache in the Mirror.

@jonasabreu
Copy link
Member Author

The idea behind this issue was to check if it was possible to use some internals and a bit of trickery to improve speed. At least till java 6, the openjdk had (I have not checked this in a long while) an internal interface to represent a method (sun.reflect.MethodAccessor) that was cached and reused inside Method (http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/reflect/Method.java ). Changing this method accessor to something we created, we could basically cache anything we wanted. But I never got too deep and still don't know if it is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants