@Test public void testResetNodeStore() { int[] n = {100, 1000, 10000, 100000}; for (int nodes : n) { NanoBench.create().measurements(10).measure("reset node store "+nodes, new NodeStoreBenchmark().resetNodeStore(nodes)); } }
public Runnable resetNodeStore(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(); final List<Node> nodeList = graph.getNodes(); Runnable runnable = new Runnable() { @Override public void run() { for (Node n : nodeList) { nodeStore.remove(n); } for (Node n : nodeList) { nodeStore.add(n); } } }; return runnable; }
NodeStoreBenchmark { public Runnable resetNodeStore(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(); final List<Node> nodeList = graph.getNodes(); Runnable runnable = new Runnable() { @Override public void run() { for (Node n : nodeList) { nodeStore.remove(n); } for (Node n : nodeList) { nodeStore.add(n); } } }; return runnable; } }
NodeStoreBenchmark { public Runnable resetNodeStore(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(); final List<Node> nodeList = graph.getNodes(); Runnable runnable = new Runnable() { @Override public void run() { for (Node n : nodeList) { nodeStore.remove(n); } for (Node n : nodeList) { nodeStore.add(n); } } }; return runnable; }  }
NodeStoreBenchmark { public Runnable resetNodeStore(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(); final List<Node> nodeList = graph.getNodes(); Runnable runnable = new Runnable() { @Override public void run() { for (Node n : nodeList) { nodeStore.remove(n); } for (Node n : nodeList) { nodeStore.add(n); } } }; return runnable; }  Runnable iterateStore(final int nodes); Runnable resetNodeStore(final int nodes); Runnable pushStore(int nodes); }
NodeStoreBenchmark { public Runnable resetNodeStore(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(); final List<Node> nodeList = graph.getNodes(); Runnable runnable = new Runnable() { @Override public void run() { for (Node n : nodeList) { nodeStore.remove(n); } for (Node n : nodeList) { nodeStore.add(n); } } }; return runnable; }  Runnable iterateStore(final int nodes); Runnable resetNodeStore(final int nodes); Runnable pushStore(int nodes);  }