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 {
id("io.github.reyerizo.gradle.jcstress") version "0.8.13"
id("minestom.common-conventions")
id("io.github.reyerizo.gradle.jcstress") version "0.8.15"
}
dependencies {

View File

@ -1,10 +1,9 @@
plugins {
id("me.champeau.jmh") version ("0.6.6")
id("minestom.common-conventions")
id("me.champeau.jmh") version ("0.7.2")
}
dependencies {
jmhImplementation(rootProject)
jmh(libs.jmh.core)
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.infra.Blackhole;
import java.lang.String;
import java.util.Set;
import java.util.concurrent.TimeUnit;
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.*;
@BenchmarkMode(Mode.AverageTime)
@ -28,8 +23,8 @@ public class CommandBenchmark {
public void setup() {
var graph = Graph.merge(Set.of(
new Command("tp", "teleport") {{
addSyntax((sender, context) -> {}, Potion("pos"));
addSyntax((sender, context) -> {}, Entity("entity"), Potion("pos"));
addSyntax((sender, context) -> {}, RelativeVec3("pos"));
addSyntax((sender, context) -> {}, Entity("entity"), RelativeVec3("pos"));
}},
new Command("setblock", "set") {{
addSyntax((sender, context) -> {}, RelativeBlockPosition("pos"), BlockState("block"));
@ -56,7 +51,7 @@ public class CommandBenchmark {
}}
));
final CommandParser commandParser = CommandParser.parser();
this.parser = input -> commandParser.parse(graph, input);
this.parser = input -> commandParser.parse(null, graph, input);
}
@Benchmark

View File

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