-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into testUpgradePlugin
- Loading branch information
Showing
501 changed files
with
27,056 additions
and
7,420 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionSha256Sum=1541fa36599e12857140465f3c91a97409b4512501c26f9631fb113e392c5bd1 | ||
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6 |
This file contains 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
This file contains 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
This file contains 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
70 changes: 70 additions & 0 deletions
70
rewrite-benchmarks/src/jmh/java/org/openrewrite/benchmarks/java/JavaParserBenchmark.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright 2022 the original author or authors. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* <p> | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.openrewrite.benchmarks.java; | ||
|
||
import org.openjdk.jmh.annotations.*; | ||
import org.openjdk.jmh.infra.Blackhole; | ||
import org.openjdk.jmh.profile.GCProfiler; | ||
import org.openjdk.jmh.runner.Runner; | ||
import org.openjdk.jmh.runner.RunnerException; | ||
import org.openjdk.jmh.runner.options.Options; | ||
import org.openjdk.jmh.runner.options.OptionsBuilder; | ||
import org.openrewrite.InMemoryExecutionContext; | ||
import org.openrewrite.java.JavaParser; | ||
import org.openrewrite.java.internal.AdaptiveRadixJavaTypeCache; | ||
import org.openrewrite.java.internal.JavaTypeCache; | ||
|
||
import java.net.URISyntaxException; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Fork(1) | ||
@Measurement(iterations = 2) | ||
@Warmup(iterations = 2) | ||
@BenchmarkMode(Mode.Throughput) | ||
@OutputTimeUnit(TimeUnit.SECONDS) | ||
@Threads(4) | ||
public class JavaParserBenchmark { | ||
|
||
@Benchmark | ||
public void snappy(JavaCompilationUnitState state, Blackhole bh) { | ||
JavaTypeCache typeCache = new JavaTypeCache(); | ||
JavaParser parser = state.javaParser.typeCache(typeCache).build(); | ||
parser | ||
.parse(state.inputs, null, new InMemoryExecutionContext()) | ||
.forEach(bh::consume); | ||
} | ||
|
||
@Benchmark | ||
public void adaptiveRadix(JavaCompilationUnitState state, Blackhole bh) { | ||
AdaptiveRadixJavaTypeCache typeCache = new AdaptiveRadixJavaTypeCache(); | ||
JavaParser parser = state.javaParser.typeCache(typeCache).build(); | ||
parser | ||
.parse(state.inputs, null, new InMemoryExecutionContext()) | ||
.forEach(bh::consume); | ||
} | ||
|
||
public static void main(String[] args) throws RunnerException, URISyntaxException { | ||
Options opt = new OptionsBuilder() | ||
.include(JavaParserBenchmark.class.getSimpleName()) | ||
.addProfiler(GCProfiler.class) | ||
.shouldFailOnError(true) | ||
.build(); | ||
new Runner(opt).run(); | ||
JavaCompilationUnitState state = new JavaCompilationUnitState(); | ||
state.setup(); | ||
state.printMemory(); | ||
} | ||
} |
Oops, something went wrong.