Measure serialization and deserialization time

情到浓时终转凉″ 提交于 2020-03-16 08:18:42

问题


In addition to my previous question please, is there a way to measure the time it takes gremlin server to serialize and deserialize a query request from the client? For example, if the client is a java application that sends query request to gremlin server running on a remote server, is there a way to measure the time from the point gremlin server receives the request, deserializes it, before running the query?

Many thanks


回答1:


No - I can't think of how to do that directly, but when you write your timing requirement like this:

the time from the point gremlin server receives the request, deserializes it, before running the query

it sounds like you only care about measuring the deserialization time in which case I'd suggest that you get Gremlin Server itself out of the way and write performance tests for the deserializer directly. You could write your tests against the driver MessageSerializer implementations which can be found here. Those classes are used by both the driver and the server for all serialization/deserialization activities.

I'm not sure what kind of benchmark you are looking to write, but in the most simple case you could just instantiate the serializer you care about testing, for example, GraphSONMessageSerializerV3d0, construct a RequestMessage as a ByteBuf (the only "hard" part) and time the method call to deserializeRequest(). You can see an example of how all this works in TinkerPop's micro-benchmarks for serialization here which uses the JMH toolkit.



来源:https://stackoverflow.com/questions/60299092/measure-serialization-and-deserialization-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!