EdgeStoreBenchmark { public Runnable iterateEdgeStoreNeighborsInOut(int nodes, double prob) { final Configuration config = new Configuration(); config.setEdgeIdType(Integer.class); config.setNodeIdType(Integer.class); final RandomGraph graph = new RandomGraph(nodes, prob, config).generate().commit(); final EdgeStore edgeStore = graph.getStore().getEdgeStore(); final List<Node> nodeList = graph.getNodes(); Runnable runnable = new Runnable() { @Override public void run() { for (Node node : nodeList) { Iterator<Edge> itr = edgeStore.edgeIterator(node); for (; itr.hasNext();) { object = itr.next(); } } } }; return runnable; }  Runnable pushEdgeStore(int nodes, double prob); Runnable iterateEdgeStore(int nodes, double prob); Runnable iterateEdgeStoreNeighborsOut(int nodes, double prob); Runnable iterateEdgeStoreNeighborsInOut(int nodes, double prob); Runnable resetEdgeStore(int nodes, double prob);  }
@Test public void testIterateInOutNeighbors() { int[] n = {100, 1000, 5000}; double[] p = {0.01, 0.1, 0.3}; for (int nodes : n) { for (double prob : p) { int edges = (int) (nodes * (nodes - 1) * prob); NanoBench.create().measurements(2).measure("iterate neighbors list in&out nodes=" + nodes + " edges=" + edges, new EdgeStoreBenchmark().iterateEdgeStoreNeighborsInOut(nodes, prob)); } } }