Ops, You're right. My mistake sorry for that.
I created a new test class, that looks 10% faster than original code.

```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 ClientBenchmark {


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

    @Setup
    public void setup() {
    }

    @Benchmark
    public String write() throws JsonProcessingException {
        return mapper.writeValueAsString(vertex);
    }


}
```

Original code:    avgt   60  1938,602 ± 50,353  ns/op
The code changed: avgt   60  2144,034 ± 51,190  ns/op  (10% faster)


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

Reply via email to