otaviojava opened a new pull request #1001: uses the directly field instead of getter method URL: https://github.com/apache/tinkerpop/pull/1001 Hello everyone, I still studying the code to help more in the project, then I found a small performance improvement. That is access the field directly instead of using the getter setter. ```java @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 20, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(3) @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @State(Scope.Thread) public class Benchmark { private final Person person = new Person(); @Setup public void setup() { } @Benchmark public String fieldDirectly() { return person.name; } @Benchmark public String getMethod() { return person.getName(); } private class Person { private final String name = "ada"; public String getName() { return name; } } } ``` * Benchmark.fieldDirectly avgt 60 2,768 ± 0,011 ns/op * Benchmark.getMethod avgt 60 3,010 ± 0,052 ns/op (around 12% slower)
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
