NodeStoreBenchmark { public Runnable iterateStore(final int nodes) { final Configuration config = new Configuration(); config.setEdgeIdType(Integer.class); config.setNodeIdType(Integer.class); final RandomGraph graph = new RandomGraph(nodes, 0, config).generate().commit(); final NodeStore nodeStore = graph.getStore().getNodeStore(); Runnable runnable = new Runnable() { @Override public void run() { Iterator<Node> m = nodeStore.iterator(); for (; m.hasNext();) { NodeImpl b = (NodeImpl) m.next(); object = b; } } }; return runnable; }  Runnable iterateStore(final int nodes); Runnable resetNodeStore(final int nodes); Runnable pushStore(int nodes);  }
@Test public void testIterateStore() { int[] n = {100, 1000, 10000, 100000}; for (int nodes : n) { NanoBench.create().cpuOnly().measurements(10).measure("iterate node store " + nodes, new NodeStoreBenchmark().iterateStore(nodes)); } }