uschindler opened a new pull request #1837:
URL: https://github.com/apache/lucene-solr/pull/1837


   This PR is a first (but already working) idea of using Java 15 hidden 
classes (see https://openjdk.java.net/jeps/371) to implement the Lucene 
expressions. The big advantages:
   - No classloader for every expression is needed, because the class is 
completely anonymous and has no strong reference to a classloader. Actually the 
class has a classloader to lookup any referenced other class, but it is NOT 
loaded by any classloader
   - The class can easily be unloaded
   - The performance of loading that class is better, as no locks can occur 
(classloaders have locks when looking up classes), see 
https://issues.apache.org/jira/browse/LUCENE-7882
   
   Backside:
   - The class and its methods do not appear in any stack trace. This also 
fails one test in the test suite. When using this for Lucene expressions, we 
have to think about a better way how to make the source code and method calls 
visible in stack traces. Like lambda frames the hidden class is not visible 
(unless enabled in JVM to show hidden frames).
   - It currently does not work if you pass a different classloader than 
Lucene's to the expressions module. To allow this we need to change APIs a bit 
(Classloader -> Lookup).
   
   @mikemccand can you test this with JDK 15 (release candidate) and your test. 
You should not see any locks anymore, speed should be higher, and the created 
anonymous classes should be unloaded very fast.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to