-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add optional ability to use Turbine #165
Conversation
i did few perf test on my mac mini m1 16gb: i used my crysknife demo that contains elemental2-* and many gwtproject modules including heavy like gwt-widgets with turbine: (base) treblereel@Dmitiis-Mac-mini demo % hyperfine --runs 10 'mvn clean package' without : Benchmark 1: mvn clean package as @niloc132 can see, tubine is slightly faster, the main bottle neck is ADVANCED comp mode. So i think, adding turbine makes sense only if we want to have incremental mode. The good news, turbine isn't slower. |
Excellent - I wasn't hoping for performance improvements here, but that this would instead make non-clean builds faster with only some modules changing. |
@niloc132 few notes:
|
As long as you are only focusing on the stripped-bytecode and stripped-bytecode-headers, we don't care about APT, that is already finished. It would make sense later to follow up and work on the APT also, but that's an earlier phase of the build, and we're still using javac for that. If this task fails, whether turbine or javac, we can safely ignore it, since APT isn't necessary (and we can't tell which dependencies are apt-only, which are actual runtime deps). -- if jars are not optional, we can either tweak how j2cl runs to use that jar (assuming that the jar is 100% deterministic...), or we can add a "make a jar before compiling" like how you unzip afterwards. Not pretty, but it will work, and probably still worth it performance-wise. Definitely should consider patching turbine to support just reading off the filesystem though. |
Bumps [maven-shared-utils](https://github.com/apache/maven-shared-utils) from 3.1.0 to 3.3.3. - [Release notes](https://github.com/apache/maven-shared-utils/releases) - [Commits](apache/maven-shared-utils@maven-shared-utils-3.1.0...maven-shared-utils-3.3.3) --- updated-dependencies: - dependency-name: org.apache.maven.shared:maven-shared-utils dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Update from discussion in gitter: we're going to have this feature optional (but disabled by default in 0.20), and require java11 rather than add the java version check. Starting in 0.21, the tooling will require java11, since closure compiler is also dropping java8 support. Turbine will likely be enabled by default starting in 0.21. |
|
||
@Override | ||
public Task resolve(Project project, Config config) { | ||
int version = getJavaVersion(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@niloc132 so we keep it for now and ll remove it in 0.21, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - we could probably just fail now too though, your call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let simplify it for now
.setSources(ImmutableList.copyOf(sources)) | ||
.setOutput(output.toString()) | ||
.setClassPath(ImmutableList.copyOf(deps)) | ||
//TODO take a look at ReducedClasspathMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ticket for TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ticket is created
extractJar(output.toString(), resultFolder.toString()); | ||
} catch (TurbineError e) { | ||
//ohhhh apt is in maven reactor | ||
System.out.println(e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the logger in the context, or just drop the error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -44,4 +48,12 @@ public Scope getScope() { | |||
public void setScope(Scope scope) { | |||
this.scope = scope; | |||
} | |||
|
|||
public File getJar() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be unused now, read but never written - can we revert this?
j2cl-tasks/src/main/java/com/vertispan/j2cl/build/provided/TurbineTask.java
Outdated
Show resolved
Hide resolved
j2cl-tasks/src/main/java/com/vertispan/j2cl/build/provided/TurbineTask.java
Outdated
Show resolved
Hide resolved
j2cl-tasks/src/main/java/com/vertispan/j2cl/build/provided/TurbineTask.java
Outdated
Show resolved
Hide resolved
}; | ||
} | ||
|
||
public void extractJar(String zipFilePath, String extractDirectory) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a quick look at 22319e6? I used that zip unpacking code originally to deal with j2cl tools that didnt know how to use the filesystem directly. That would let us drop the new commons-compress dependency.
build-caching/src/main/java/com/vertispan/j2cl/build/Dependency.java
Outdated
Show resolved
Hide resolved
j2cl-tasks/src/main/java/com/vertispan/j2cl/build/provided/TurbineTask.java
Outdated
Show resolved
Hide resolved
j2cl-tasks/src/main/java/com/vertispan/j2cl/build/provided/TurbineTask.java
Outdated
Show resolved
Hide resolved
j2cl-tasks/src/main/java/com/vertispan/j2cl/build/provided/TurbineTask.java
Outdated
Show resolved
Hide resolved
pom.xml
Outdated
@@ -105,6 +105,7 @@ | |||
<error.prone.annotations.version>2.1.3</error.prone.annotations.version> | |||
<jsr305.version>3.0.2</jsr305.version> | |||
<commons.lang3.version>3.8.1</commons.lang3.version> | |||
<google.turbine.version>v20220503-SNAPSHOT</google.turbine.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll finish this release so you can skip SNAPSHOT here, since it looks like we're solid, just some future plans to stop requiring a zip right?
…y.java Co-authored-by: Colin Alworth <colin@vertispan.com>
…bineTask.java Co-authored-by: Colin Alworth <colin@vertispan.com>
…bineTask.java Co-authored-by: Colin Alworth <colin@vertispan.com>
…bineTask.java Co-authored-by: Colin Alworth <colin@vertispan.com>
Turbine is a header compiler for Java that allows us to reduce the
source code to parse, leading to decreased compile time. By ignoring
changes in the body, we can also avoid downstream builds that can be
skipped.
This feature is optional for now, but may be set to the default in a
future release. To enable this, assign the taskMappings key of
stripped_bytecode_headers
to the valueturbine
.Co-authored-by: Colin Alworth colin@vertispan.com
Fixes #150