get back jmh/jcstress

This commit is contained in:
themode 2024-07-12 15:23:07 +02:00
parent 79716ab749
commit a68d13a995
4 changed files with 8 additions and 15 deletions

View File

@ -1,6 +1,5 @@
plugins { plugins {
id("io.github.reyerizo.gradle.jcstress") version "0.8.13" id("io.github.reyerizo.gradle.jcstress") version "0.8.15"
id("minestom.common-conventions")
} }
dependencies { dependencies {

View File

@ -1,10 +1,9 @@
plugins { plugins {
id("me.champeau.jmh") version ("0.6.6") id("me.champeau.jmh") version ("0.7.2")
id("minestom.common-conventions")
} }
dependencies { dependencies {
jmhImplementation(rootProject) jmhImplementation(rootProject)
jmh(libs.jmh.core) jmh(libs.jmh.core)
jmhAnnotationProcessor(libs.jmh.annotationprocessor) jmhAnnotationProcessor(libs.jmh.annotationprocessor)
} }

View File

@ -4,15 +4,10 @@ import net.minestom.server.command.builder.Command;
import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole; import org.openjdk.jmh.infra.Blackhole;
import java.lang.String;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.function.Function; import java.util.function.Function;
import static net.minestom.server.command.builder.arguments.ArgumentType.Double;
import static net.minestom.server.command.builder.arguments.ArgumentType.Float;
import static net.minestom.server.command.builder.arguments.ArgumentType.Integer;
import static net.minestom.server.command.builder.arguments.ArgumentType.Long;
import static net.minestom.server.command.builder.arguments.ArgumentType.*; import static net.minestom.server.command.builder.arguments.ArgumentType.*;
@BenchmarkMode(Mode.AverageTime) @BenchmarkMode(Mode.AverageTime)
@ -28,8 +23,8 @@ public class CommandBenchmark {
public void setup() { public void setup() {
var graph = Graph.merge(Set.of( var graph = Graph.merge(Set.of(
new Command("tp", "teleport") {{ new Command("tp", "teleport") {{
addSyntax((sender, context) -> {}, Potion("pos")); addSyntax((sender, context) -> {}, RelativeVec3("pos"));
addSyntax((sender, context) -> {}, Entity("entity"), Potion("pos")); addSyntax((sender, context) -> {}, Entity("entity"), RelativeVec3("pos"));
}}, }},
new Command("setblock", "set") {{ new Command("setblock", "set") {{
addSyntax((sender, context) -> {}, RelativeBlockPosition("pos"), BlockState("block")); addSyntax((sender, context) -> {}, RelativeBlockPosition("pos"), BlockState("block"));
@ -56,7 +51,7 @@ public class CommandBenchmark {
}} }}
)); ));
final CommandParser commandParser = CommandParser.parser(); final CommandParser commandParser = CommandParser.parser();
this.parser = input -> commandParser.parse(graph, input); this.parser = input -> commandParser.parse(null, graph, input);
} }
@Benchmark @Benchmark

View File

@ -2,7 +2,7 @@ rootProject.name = "minestom"
include("testing") include("testing")
include("code-generators") include("code-generators")
//include("jmh-benchmarks") include("jmh-benchmarks")
//include("jcstress-tests") include("jcstress-tests")
include("demo") include("demo")