Skip to content

Julia v0.5.0 dictionary iteration is >10x slower than v0.4.6 #18331

@chipkent

Description

@chipkent

After porting my code to Julia v0.5.0, I am seeing a 3x reduction in speed in a critical area. I have narrowed the root cause down to what appears to be slow dictionary iteration in v0.5.0.

Reproducer code:
https://gist.github.com/chipkent/c8e3acc4f64bd78db4fe40f2c42072f2

---- Julia v0.5.0-rc3
julia> versioninfo()
Julia Version 0.5.0-rc3+0
Commit e6f843b (2016-08-22 23:43 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, ivybridge)

julia> @benchmark lratio2(dd)
BenchmarkTools.Trial: 
  samples:          10000
  evals/sample:     1
  time tolerance:   5.00%
  memory tolerance: 1.00%
  memory estimate:  816.00 bytes
  allocs estimate:  31
  minimum time:     35.40 μs (0.00% GC)
  median time:      35.88 μs (0.00% GC)
  mean time:        36.08 μs (0.00% GC)
  maximum time:     59.26 μs (0.00% GC)
---- Julia v0.5.0-rc3
julia> versioninfo()
Julia Version 0.4.6
Commit 2e358ce (2016-06-19 17:16 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

julia> @benchmark lratio2(dd)

BenchmarkTools.Trial: 
  samples:          10000
  evals/sample:     9
  time tolerance:   5.00%
  memory tolerance: 1.00%
  memory estimate:  816.00 bytes
  allocs estimate:  31
  minimum time:     2.73 μs (0.00% GC)
  median time:      2.77 μs (0.00% GC)
  mean time:        2.90 μs (2.74% GC)
  maximum time:     339.18 μs (98.62% GC)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs docsDocumentation for this change is requiredperformanceMust go fasterpotential benchmarkCould make a good benchmark in BaseBenchmarks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions