You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2021/11/28 20:10:40 UTC

[lucene] branch main updated: Speed up ECJ tasks by avoiding --release (#484)

This is an automated email from the ASF dual-hosted git repository.

rmuir pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 63c89f6  Speed up ECJ tasks by avoiding --release (#484)
63c89f6 is described below

commit 63c89f678d48deb9a40b90498409ad5656d775ce
Author: Robert Muir <rm...@apache.org>
AuthorDate: Sun Nov 28 15:10:32 2021 -0500

    Speed up ECJ tasks by avoiding --release (#484)
    
    LUCENE-10185 caused a large performance regression in ECJ tasks by using the --release flag.
    
    Instead of using --release, we can just disable "terminal deprecation", and leave this check to `javac`. The --release flag makes this tool run 50% slower.
---
 gradle/validation/ecj-lint.gradle             | 4 +++-
 gradle/validation/ecj-lint/ecj.javadocs.prefs | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gradle/validation/ecj-lint.gradle b/gradle/validation/ecj-lint.gradle
index a8f7e28..398c26e 100644
--- a/gradle/validation/ecj-lint.gradle
+++ b/gradle/validation/ecj-lint.gradle
@@ -63,7 +63,9 @@ allprojects {
         args += [ "-d", "none" ]
 
         // Compilation environment.
-        args += [ "--release", project.java.targetCompatibility ]
+        // we use -source/-target as it is significantly faster than --release
+        args += [ "-source", project.java.sourceCompatibility ]
+        args += [ "-target", project.java.targetCompatibility ]
         args += [ "-encoding", "UTF-8"]
         args += [ "-proc:none" ]
         args += [ "-nowarn" ]
diff --git a/gradle/validation/ecj-lint/ecj.javadocs.prefs b/gradle/validation/ecj-lint/ecj.javadocs.prefs
index 0bad875..a5352aa 100644
--- a/gradle/validation/ecj-lint/ecj.javadocs.prefs
+++ b/gradle/validation/ecj-lint/ecj.javadocs.prefs
@@ -101,7 +101,9 @@ org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=error
 org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.terminalDeprecation=error
+# Ignore terminal deprecation, allowing this tool to run faster.
+# we can just let javac do this check instead!
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error