Closed rohitvarkey closed 8 years ago
The benchmarks for the type stable getfield
vs the type instable getfield
are shown here:
julia> stableget = read(stable, "gettrial")
BenchmarkTools.Trial:
samples: 10000000
evals/sample: 1
time tolerance: 5.00%
memory tolerance: 1.00%
memory estimate: 0.00 bytes
allocs estimate: 0
minimum time: 38.00 ns (0.00% GC)
median time: 41.00 ns (0.00% GC)
mean time: 43.95 ns (0.00% GC)
maximum time: 219.11 μs (0.00% GC)
julia> unstableget = read(unstable, "gettrial")
BenchmarkTools.Trial:
samples: 10000000
evals/sample: 1
time tolerance: 5.00%
memory tolerance: 1.00%
memory estimate: 32.00 bytes
allocs estimate: 2
minimum time: 366.00 ns (0.00% GC)
median time: 398.00 ns (0.00% GC)
mean time: 433.29 ns (1.10% GC)
maximum time: 14.44 ms (99.79% GC)
I think this clearly shows that we should stick with the type stable version with the special functions for batch_time
and update_time
.
The insert remove benchmark here gives results of
Insert benchmark (attempting to insert 100000), terminates in 10 seconds.
BenchmarkTools.Trial:
samples: 84062
evals/sample: 182
time tolerance: 5.00%
memory tolerance: 1.00%
memory estimate: 16.00 bytes
allocs estimate: 1
minimum time: 582.00 ns (0.00% GC)
median time: 586.00 ns (0.00% GC)
mean time: 650.31 ns (0.12% GC)
maximum time: 21.48 μs (0.00% GC)
Remove benchmark (25000)
BenchmarkTools.Trial:
samples: 25000
evals/sample: 178
time tolerance: 5.00%
memory tolerance: 1.00%
memory estimate: 16.00 bytes
allocs estimate: 1
minimum time: 599.00 ns (0.00% GC)
median time: 604.00 ns (0.00% GC)
mean time: 658.24 ns (0.14% GC)
maximum time: 10.11 μs (91.55% GC)
The outdegree
and successors
implementation depends on https://github.com/stingergraph/stinger/pull/204 being merged.
StingerGraph
instance with C values at that point of time.StingerFields
type to use for functions to dispatch for these enums. It also allows us to figure out the index and calculate the offset easily.getindex
to read values of the C object in a lazy manner.setindex!
to write values to the C object.getindex
andsetindex
outdegree
andsuccessors
implementationsI couldn't use
getfield
orsetfield!
and override thea.b
syntax due to https://github.com/JuliaLang/julia/issues/1974.Using
getindex
andsetindex!
along with the defined enumerations allows for usage likecc: @jpfairbanks