#79 - Added benchmark for non-reflective constructor usage.

This commit is contained in:
Oliver Gierke
2018-08-07 18:39:39 +02:00
parent 478a12bcb7
commit 02a8562d94

View File

@@ -104,6 +104,11 @@ public class TypicalEntityReaderBenchmark extends AbstractMicrobenchmark {
return read(simpleEntityData, SimpleEntityWithConstructor.class, true);
}
@Benchmark
public Object simpleEntityReflectiveConstructorArgsCreation() {
return read(simpleEntityData, SimpleEntityWithReflectiveConstructor.class, true);
}
@Benchmark
public Object kotlinDataClass() {
return read(simpleEntityData, MyDataClass.class, false);
@@ -135,7 +140,18 @@ public class TypicalEntityReaderBenchmark extends AbstractMicrobenchmark {
public String lastname;
}
static class SimpleEntityWithConstructor {
static class SimpleEntityWithReflectiveConstructor {
final String firstname;
final String lastname;
public SimpleEntityWithReflectiveConstructor(String firstname, String lastname) {
this.firstname = firstname;
this.lastname = lastname;
}
}
public static class SimpleEntityWithConstructor {
final String firstname;
final String lastname;