pranavtbhat / Graft.jl

Graph Toolkit for Julia
Other
30 stars 5 forks source link

Benchmarks on Julia Server #21

Closed pranavtbhat closed 8 years ago

pranavtbhat commented 8 years ago

This issue is to keep track of how speeds improve.

#1  Generate Graph of size (10^6, 10^8)
g = SparseGraph(10^6, 10^8)

#2 List out all edges  
es = collect(edges(g))

#3 Set an integer for each vertex
setvprop!(g, :, rand(nv(g)), "p1")

#4 Set an integer for each vertex
setvprop!(g, :, v->rand(), "p2")

#5 Fetch all integer values
getvprop(g, :, "p1")

#6 Fetch dictionaries for each vertex
getvprop(g, :)

#7 Set an integer for each edge
seteprop!(g, :, rand(ne(g)), "p1")

#8 Set an integer for 10^4 edges
seteprop!(g, es[1:10^4], (u,v)->rand(), "p2")

#9 Fetch all integer values
geteprop(g, :, "p1")

#10 Fetch 10^4 integer values
geteprop(g, es[1:10^4], "p2")

#11 Fetch dictionaries for 10^4 edges
geteprop(g, es[1:10^4])
pranavtbhat commented 8 years ago
1. 29.945258 seconds (116 allocations: 6.346 GB, 2.15% gc time)
2. 1.368865 seconds (8 allocations: 1.490 GB, 4.30% gc time)
3. 0.010837 seconds (9 allocations: 7.630 MB)
4. 0.071959 seconds (2.00 M allocations: 38.141 MB)
5. 0.005573 seconds (7 allocations: 7.630 MB)
6. 2.685934 seconds (16.00 M allocations: 785.812 MB, 15.39% gc time)
7. 3.086757 seconds (29 allocations: 3.741 GB, 5.99% gc time)
8. 10.699990 seconds (110.04 k allocations: 11.413 MB, 1.36% gc time)
9. 21.972968 seconds (299.93 M allocations: 6.705 GB, 54.69% gc time)
10. 0.023076 seconds (79.99 k allocations: 2.823 MB)
11. 5.498826 seconds (41.79 M allocations: 1.427 GB, 32.67% gc time)

4 -> Fix with function type inference in 0.5 7 -> Fix in VectorPM by simply setting vals as nzval 8 -> Fix with type inference + sizehint! on nzval androwval to cut down allocations. 9 -> Easy fix; return nzval