Repository navigation
Optimized the use of java.lang.Class#getInterfaces() in OgnlCompiler - #10
Merged
Merged
Conversation
Collaborator
|
Very neat! |
lukaszlenart
added a commit
that referenced
this pull request
May 17, 2015
Optimized the use of java.lang.Class#getInterfaces() in OgnlCompiler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most of my profiling sessions show
java.lang.Class#getInterfaces()as one of the hot spots under heavy OGNL load, because of being used at several methods inognl.enhance.ExpressionCompiler, especiallyognl.enhance.ExpressionCompiler#getInterfaceClass(java.lang.Class)Indeed it seems this
java.lang.Class#getInterfaces()method, even if being native, is quite slow for some strange reason. I've read a couple of complaints about it also related with Hibernate (see [1] and [2]).Fortunately, I was able to importantly reduce the amount of times this method has to be called in
ExpressionCompilerwithout losing any functionality, just re-structuring a bit the code. This should save a noticeable amount of execution time.[1] https://forum.hibernate.org/viewtopic.php?p=2404651
[2] https://jira.atlassian.com/browse/CRUC-4518