bovine3dom / Nauty.jl

A small Julia wrapper for nauty
Other
8 stars 5 forks source link

Julia v0.7 issues #1

Open bovine3dom opened 6 years ago

bovine3dom commented 6 years ago

Much slower:

0.6

julia> @benchmark Nauty.baked_canonical_form(iso1a).canong
BenchmarkTools.Trial:
  memory estimate:  1.38 KiB
  allocs estimate:  27
  --------------
  minimum time:     928.867 ns (0.00% GC)
  median time:      947.933 ns (0.00% GC)
  mean time:        1.092 μs (9.79% GC)
  maximum time:     65.903 μs (96.53% GC)
  --------------
  samples:          10000
  evals/sample:     30

julia> @benchmark Nauty.canonical_form(iso1a).canong
BenchmarkTools.Trial:
  memory estimate:  7.64 KiB
  allocs estimate:  125
  --------------
  minimum time:     7.115 μs (0.00% GC)
  median time:      7.333 μs (0.00% GC)
  mean time:        7.960 μs (4.19% GC)
  maximum time:     289.120 μs (92.63% GC)
  --------------
  samples:          10000
  evals/sample:     4

vs 0.7

julia> @benchmark Nauty.baked_canonical_form(iso1a).canong
BenchmarkTools.Trial:
  memory estimate:  62.33 KiB
  allocs estimate:  536
  --------------
  minimum time:     298.840 μs (0.00% GC)
  median time:      311.507 μs (0.00% GC)
  mean time:        318.929 μs (1.90% GC)
  maximum time:     34.255 ms (98.56% GC)
  --------------
  samples:          10000
  evals/sample:     1

the un-baked canonical_form just plain doesn't work:

 in module Nauty
WARNING: Base.Void is deprecated, use Nothing instead.
 in module Nauty
WARNING: Base.Void is deprecated, use Nothing instead.
 in module Nauty
WARNING: Base.Void is deprecated, use Nothing instead.
 in module Nauty
WARNING: Base.Void is deprecated, use Nothing instead.
 in module Nauty
WARNING: Base.Void is deprecated, use Nothing instead.
 in module Nauty
WARNING: Base.Void is deprecated, use Nothing instead.
 in module Nauty
WARNING: Base.Void is deprecated, use Nothing instead.
 in module Nauty
WARNING: Base.Void is deprecated, use Nothing instead.
 in module Nauty
┌ Warning: `size(x, d1::Integer, d2::Integer)` is deprecated, use `(size(x, d1), size(
x, d2))` instead.
│   caller = densenauty(::Array{UInt64,1}, ::Nauty.optionblk, ::Nothing, ::Nothing) at
 Nauty.jl:194
└ @ Nauty ~/projects/Nauty.jl/src/Nauty.jl:194
┌ Warning: `zeros(a::AbstractArray)` is deprecated, consider `zero(a)`, `fill(0, size(
a))`, `fill!(copy(a), 0)`, or `fill!(similar(a), 0)`. Where necessary, use `fill!(simi
lar(a), zero(eltype(a)))`.
│   caller = densenauty(::Array{UInt64,1}, ::Nauty.optionblk, ::Nothing, ::Nothing) at
 Nauty.jl:206
└ @ Nauty ~/projects/Nauty.jl/src/Nauty.jl:206
┌ Warning: `zeros(a::AbstractArray)` is deprecated, consider `zero(a)`, `fill(0, size(
a))`, `fill!(copy(a), 0)`, or `fill!(similar(a), 0)`. Where necessary, use `fill!(simi
lar(a), zero(eltype(a)))`.
│   caller = densenauty(::Array{UInt64,1}, ::Nauty.optionblk, ::Nothing, ::Nothing) at
 Nauty.jl:210
└ @ Nauty ~/projects/Nauty.jl/src/Nauty.jl:210
┌ Warning: `zeros(a::AbstractArray)` is deprecated, consider `zero(a)`, `fill(0, size(
a))`, `fill!(copy(a), 0)`, or `fill!(similar(a), 0)`. Where necessary, use `fill!(simi
lar(a), zero(eltype(a)))`.
│   caller = densenauty(::Array{UInt64,1}, ::Nauty.optionblk, ::Nothing, ::Nothing) at
 Nauty.jl:211
└ @ Nauty ~/projects/Nauty.jl/src/Nauty.jl:211
Error: densenauty() needs standard options block

and then Julia crashes.

bovine3dom commented 6 years ago

Most of them were depwarns but there's still probably some more speedups to be had -

BenchmarkTools.Trial: 
  memory estimate:  1.36 KiB
  allocs estimate:  25
  --------------
  minimum time:     1.929 μs (0.00% GC)
  median time:      1.994 μs (0.00% GC)
  mean time:        2.717 μs (21.20% GC)
  maximum time:     4.160 ms (99.90% GC)
  --------------
  samples:          10000
  evals/sample:     10