Last active
December 15, 2015 22:08
-
-
Save spmallette/5330353 to your computer and use it in GitHub Desktop.
Comparison of TinkerGraph serialization options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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