#79 - Added benchmark for non-reflective constructor usage.
This commit is contained in:
@@ -104,6 +104,11 @@ public class TypicalEntityReaderBenchmark extends AbstractMicrobenchmark {
|
|||||||
return read(simpleEntityData, SimpleEntityWithConstructor.class, true);
|
return read(simpleEntityData, SimpleEntityWithConstructor.class, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Benchmark
|
||||||
|
public Object simpleEntityReflectiveConstructorArgsCreation() {
|
||||||
|
return read(simpleEntityData, SimpleEntityWithReflectiveConstructor.class, true);
|
||||||
|
}
|
||||||
|
|
||||||
@Benchmark
|
@Benchmark
|
||||||
public Object kotlinDataClass() {
|
public Object kotlinDataClass() {
|
||||||
return read(simpleEntityData, MyDataClass.class, false);
|
return read(simpleEntityData, MyDataClass.class, false);
|
||||||
@@ -135,7 +140,18 @@ public class TypicalEntityReaderBenchmark extends AbstractMicrobenchmark {
|
|||||||
public String lastname;
|
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 firstname;
|
||||||
final String lastname;
|
final String lastname;
|
||||||
|
|||||||
Reference in New Issue
Block a user