Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-05 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1841494970 > While writing the benchmark I figured out that the Expression base class has some problems with a missing `IOException` on the `evaluate(DoubleValues[])` method. As bytecode knows n

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-05 Thread via GitHub
uschindler merged PR #12873: URL: https://github.com/apache/lucene/pull/12873 -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
rjernst commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1840023723 Thanks for the ping @uschindler , great idea! I opened https://github.com/elastic/elasticsearch/issues/102955 to track the same work in Elasticsearch. -- This is an automated message

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
rmuir commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839841171 some of the permissions involved are probably only safe to remove in 10.x due to #12038 -- This is an automated message from the Apache Git Service. To respond to the message, please lo

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on code in PR #12873: URL: https://github.com/apache/lucene/pull/12873#discussion_r1414718350 ## lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java: ## @@ -201,48 +226,57 @@ private static void unusedTestCompile() throws IO

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on code in PR #12873: URL: https://github.com/apache/lucene/pull/12873#discussion_r1414718350 ## lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java: ## @@ -201,48 +226,57 @@ private static void unusedTestCompile() throws IO

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on code in PR #12873: URL: https://github.com/apache/lucene/pull/12873#discussion_r1414718350 ## lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java: ## @@ -201,48 +226,57 @@ private static void unusedTestCompile() throws IO

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839826543 > I like the change! > > Can be a followup ticket, but i think we should remove `ClassLoader` usage from `TestCustomFunctions.java`. It doesn't need to use classloader to test

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
rmuir commented on code in PR #12873: URL: https://github.com/apache/lucene/pull/12873#discussion_r1414716973 ## lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java: ## @@ -201,48 +226,57 @@ private static void unusedTestCompile() throws IOExcep

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839428422 I added documentation and migration guide. -- 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

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
dweiss commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839399108 I glanced through the code and it looks good to me. This said, it's really low level and I'm not super intimate with method handles so don't trust my +1. :) -- This is an automated me

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839275419 While writing the benchmark I figured out that the Expression base class has some problems with a missing `IOException` on the `evaluate(DoubleValues[])` method. As bytecode knows no

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839265253 Benchmark was added and classloader code removed. I will add a helper function to support some compatibility with legacy code still using `java.lang.reflect.Method`, but after t

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839222928 I will also post my benchmark, as it allows to test the performance of expressions. -- This is an automated message from the Apache Git Service. To respond to the message, please lo

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839221772 Hi Robert, yes we can remove that test. We may also remove other classloader related permissions (unless they are used at other places). -- This is an automated message from the Apa

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
rmuir commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839192204 I like the change! Can be a followup ticket, but i think we should remove `ClassLoader` usage from `TestCustomFunctions.java`. It doesn't need to use classloader to test anymore, si

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1839092945 The latest commit changed the stack trace patching to be implemented inside the compiled expression. The original benchmarks had shown that the extra `evaluate()` method in the base c

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1838770783 I removed the `invokestatic` special case and now every function call is handled by a `MethodHandle` provided in a dynamic constant. P.S.: Java 17' LambdaBootsrap now does the s

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-04 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1838345039 Updated longer running benchmark, no changes: ``` Benchmark(js) (useMH) Mode Cnt Score Error Units ExpressionsBenchmark.

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-03 Thread via GitHub
uschindler commented on PR #12873: URL: https://github.com/apache/lucene/pull/12873#issuecomment-1837669165 Hi, I prepared a JMH benchmark and compared results. I made the "enforce MH mode" configurable when compiling the JS expression: ```java package org.apache.lucene.benchmark.j

Re: [PR] Rewrite JavaScriptCompiler to use modern JVM features (Java 17) [lucene]

2023-12-03 Thread via GitHub
uschindler commented on code in PR #12873: URL: https://github.com/apache/lucene/pull/12873#discussion_r1413150788 ## lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java: ## @@ -201,48 +210,75 @@ private static void unusedTestCompile() throws IO