tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From otaviojava (GitHub) <git...@apache.org>
Subject [GitHub] [tinkerpop] otaviojava commented on issue #1001: uses the directly field instead of getter method
Date Tue, 11 Dec 2018 09:11:52 GMT
@robertdale @spmallette 

The JMH is a microbenchmark that the OpenJDK uses to performance improvement that is trustful.
The issue was a compiler trick that I did a mistake.
The code below will show the same result on both metrics:


```java
@Warmup(iterations = 5, time = 1)
@Measurement(iterations = 20, time = 1)
@Fork(3)
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Thread)
public class ClientBenchmark {


    private ObjectMapper mapper = GraphSONMapper.build().version(GraphSONVersion.V3_0).create().createMapper();
    private Graph graph = TinkerFactory.createModern();
    private Vertex vertex = graph.traversal().V().next();

    @Setup
    public void setup() {
        this.mapper = GraphSONMapper.build().version(GraphSONVersion.V3_0).create().createMapper();
        this.graph = TinkerFactory.createModern();
        this.vertex = graph.traversal().V().next();
    }

    @Benchmark
    public String write(Blackhole blackhole) throws JsonProcessingException {
        String value = mapper.writeValueAsString(vertex);
        blackhole.consume(value);
        return value;
    }

}

```



[ Full content available at: https://github.com/apache/tinkerpop/pull/1001 ]
This message was relayed via gitbox.apache.org for dev@tinkerpop.apache.org

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message