title: OrientDB slow write
body: <p>OrientDB official site says:</p>
  
  <blockquote>
    <p>On common hardware stores up to 150.000 documents per second, 10
    billions of documents per day. Big Graphs are loaded in few
    milliseconds without executing costly JOIN such as the Relational
    DBMSs.</p>
  </blockquote>
  
  <p>But, executing the following code shows that it's taking ~17000ms to insert 150000 simple documents.</p>
  
  <pre><code>import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
  import com.orientechnologies.orient.core.record.impl.ODocument;
  
  public final class OrientDBTrial {
  
      public static void main(String[] args) {
          ODatabaseDocumentTx db = new ODatabaseDocumentTx("remote:localhost/foo");
          try {
              db.open("admin", "admin");
  
              long a = System.currentTimeMillis();
              for (int i = 1; i &lt; 150000; ++i) {
                  final ODocument foo = new ODocument("Foo");
                  foo.field("code", i);
                  foo.save();
              }
              long b = System.currentTimeMillis();
              System.out.println(b - a + "ms");
  
              for (ODocument doc : db.browseClass("Foo")) {
                  doc.delete();
              }
          } finally {
              db.close();
          }
      }
  
  }
  </code></pre>
  
  <p>My hardware:</p>
  
  <ul>
  <li>Dell Optiplex 780</li>
  <li>Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93Ghz</li>
  <li>8GB RAM</li>
  <li>Windows 7 64bits</li>
  </ul>
  
  <p>What am I doing wrong?</p>
  
  <p>Splitting the saves in 10 concurrent threads to minimize Java's overhead made it run in ~13000ms. Still far slower than what OrientDB front page says.</p>