Hi, I will try to assist:
- Use latest version: 1.7-rc2-SNAPSHOT - Use "plocal" storage: https://github.com/orientechnologies/orientdb/wiki/plocal-storage-engine - Use Massive Intent: db.declareIntent( new OIntentMassiveInsert() ); - Read the available material: https://github.com/orientechnologies/orientdb/wiki/Performance-Tuning Regards, -Stefán On Monday, 18 November 2013 16:40:58 UTC, Sotiris Beis wrote: > > Hi, > > I have this code snippet that read a dataset and creates a graph database > with OrientDB. Is there any suggestions in order to improve the performance > of the procedure? > > OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false); > > OGlobalConfiguration.TX_USE_LOG.setValue(false); > > OGlobalConfiguration.ENVIRONMENT_CONCURRENT.setValue(false); > > OrientGraphNoTx orientGraph = new OrientGraphNoTx( > "local:data/orient"); > > orientGraph.getRawGraph().declareIntent(new > OIntentMassiveInsert()); > > > > orientGraph.createIndex("nodeId", OrientVertex.class); > > Index<OrientVertex> vetrices = orientGraph.getIndex("nodeId", > OrientVertex.class); > > > > long start = System.nanoTime(); > > long end = 0; > > try { > > BufferedReader reader = new BufferedReader(new > InputStreamReader(new FileInputStream("data/flickrEdges.txt"))); > > String line; > > int lineCounter = 1; > > OrientVertex srcVertex, dstVertex; > > Iterable<OrientVertex> cache; > > while((line = reader.readLine()) != null) { > > if(lineCounter > 4) { > > String[] parts = line.split(" "); > > > > cache = vetrices.get("nodeId",parts > [0]); > > if(cache.iterator().hasNext()) { > > srcVertex = cache.iterator > ().next(); > > } > > else { > > srcVertex = orientGraph. > addVertex(null, "nodeId", parts[0] ); > > vetrices.put("nodeId",parts > [0], srcVertex); > > } > > > > cache = vetrices.get("nodeId",parts > [1]); > > if(cache.iterator().hasNext()) { > > dstVertex = cache.iterator > ().next(); > > } > > else { > > dstVertex = orientGraph. > addVertex(null, "nodeId", parts[1] ); > > vetrices.put("nodeId",parts > [1], dstVertex); > > } > > > > Edge edge = orientGraph.addEdge( > null, srcVertex, dstVertex, "similar"); > > } > > lineCounter++; > > } > > > > <span style="color: > ... -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
