Skip to content

Instantly share code, notes, and snippets.

@spmallette
Last active December 15, 2015 22:08
Show Gist options
  • Save spmallette/5330353 to your computer and use it in GitHub Desktop.
Save spmallette/5330353 to your computer and use it in GitHub Desktop.
Comparison of TinkerGraph serialization options.
types = [(TinkerGraph.FileType.GRAPHSON) : '/tmp/tg/graphson',
(TinkerGraph.FileType.GML) : '/tmp/tg/gml',
(TinkerGraph.FileType.GRAPHML) : '/tmp/tg/graphml',
(TinkerGraph.FileType.JAVA) : '/tmp/tg/java']
m = [:]
types.each{ gt ->
graph = new TinkerGraph(gt.value, gt.key);
graph.createKeyIndex("index", Vertex.class);
for (int i = 0; i < 1000; i++) {
v = graph.addVertex(i);
v.setProperty("index", i);
}
generator = new DistributionGenerator("knows");
generator.setOutDistribution(new PowerLawDistribution(2.1));
generator.generate(graph,2000);
start = System.currentTimeMillis()
graph.shutdown()
m[(gt.key)] = (System.currentTimeMillis() - start)
}
m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment