jeleb
jeleb

Reputation: 643

timing queries in gremlin-console

I am trying to compare the response time of my queries in gremlin-console (the graph database is janusgraph, and the backend database is hbase). To do that, there is the "clock()" step, that can run the query multiple times and return the average response time.

But as stated in the documentation, there is a "warm up" phase :

The warm up simply consists of running the query one time before timing starts. This means that for a single timing iteration, the human perceived time will be roughly double the time returned by the clock analysis.

Because of that warm up phase, all the graph needed for the traversal is always in the cache, which will not be true in the real world. For example, the query I am working on takes 6 minutes to complete because there is a lot of data to fetch from the hbase backend, but the clock() step display a execution time of 10s, which could only be true in the best scenario.

Is there another, better way to get a correct execution time of my queries using gremlin-console ?

Upvotes: 3

Views: 1190

Answers (1)

stephen mallette
stephen mallette

Reputation: 46206

I think you can still use clock(). Just rollback the transaction between executions:

clock { g.V().iterate();g.tx().rollback() }

Upvotes: 1

Related Questions