title: OrientDB vs Neo4j, simple stress test
body: <p>I'm posting because I'm having strange results while stressing Neo4j 2.2.7 and OrientDB 2.1.4 and I am looking for an explanation (I'm pretty sure there is no bug in the code but if anyone is interested I'd be happy to share it).
  Here are the facts:</p>
  
  <ol>
  <li><p>I'm continuously shooting to the DBs the following OSql and Cypher queries, which are equivalent (except for the name of the attributes)</p>
  
  <ul>
  <li><code>SELECT both('Meets').email FROM Employee WHERE nt_account = '&lt;employeeid&gt;'</code></li>
  <li><code>MATCH (e: Employee {Nt_Account: '&lt;employeeid&gt;'}) -[:MEETS]- (y: Employee) RETURN y.E_Mail</code></li>
  </ul></li>
  <li><p><code>nt_account</code> and <code>Nt_Account</code> are both indexed. </p></li>
  <li><p>the execution time of the queries, averaged over 100 repetitions, is: </p>
  
  <ul>
  <li>OrientDB: 4.4ms</li>
  <li>Neo4j: 7.6ms</li>
  </ul></li>
  <li><p>to parallelise execution I'm using AKKA actors</p></li>
  <li><p>Despite of the previous points, when continuously shooting the above mentioned queries from just one thread, I measured that Neo4j can serve ~59k requests, while OrientDB can serve ~16k requests.</p></li>
  <li><p>The number of requests OrientDB could serve is consistently 3 to 5 times lower than Neo4j.</p></li>
  </ol>
  
  <p>As you can imagine, points 5. and 6. shocked me a bit as I was expecting the number of requests served by OrientDB to be the greatest, given that it can execute the query in almost half of the time.</p>
  
  <p>Does anybody have any idea of what's going on? 
  Is OrientDB doing something after having returned the query result?
  Am I using the API unproperly?</p>
  
  <hr>
  
  <p><strong>More detail:</strong></p>
  
  <p>Here is how I execute the query in OrientDB (I found this <a href="http://orientdb.com/docs/2.1/Graph-Database-Tinkerpop.html" rel="nofollow noreferrer">here</a>):</p>
  
  <pre><code>val start = System.currentTimeMillis()
  graph.command(new OCommandSQL(&lt;the_query&gt;)).execute()
  val ellapsedTime = System.currentTimeMillis() - start
  </code></pre>
  
  <p><code>graph</code> is an <code>OrientGraphNoTx</code> instance, there is one such instance per actor. 
  I got comparable results by using the <code>OrientGraph</code> and a number of requests slightly lower by using the REST API.</p>
  
  <p>Here is the method I used to execute the Neo4j query (notice that I turned off JSON streaming):</p>
  
  <pre><code>def queryRest(query: String): Unit = {
    val reqData = s"""{"statements" : [ { "statement" : "$query" } ] }"""
    val response = Http("http://localhost:7474/db/data/transaction/commit")
      .postData(reqData)
      .header("content-type", "application/json")
      .header("accept", "application/json;stream=false")
      .asString.body.length
  }
  </code></pre>
  
  <p>Here are the measurements (the last row of both tables does not make much sense as the effective level of parallelism I achieved, <code>computation_time / 1minute</code>, is only ~12).
  <a href="https://i.stack.imgur.com/ln6VB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ln6VB.png" alt="my results"></a></p>