# Performance issues when working with dict

**URL:** <https://discourse.julialang.org/t/performance-issues-when-working-with-dict/74565>\
**Category:** Performance\
**Tags:** dictionary\
**Created:** [January 13, 2022, 4:49pm UTC](https://discourse.julialang.org/t/performance-issues-when-working-with-dict/74565 "2022-01-13T16:49:58Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [January 14, 2022, 7:32am UTC](https://discourse.julialang.org/t/performance-issues-when-working-with-dict/74565/4 "2022-01-14T07:32:07Z")

</div>

Are `order` and `route` concrete types, i.e. `isconcretetype(order)==true`? If not that might be part of the problem.

Concerning the hashing, see [Collections and Data Structures · The Julia Language](https://docs.julialang.org/en/v1/base/collections/#Dictionaries) and

```julia
help?> hash
search: hash hasmethod haskey hasfield hasproperty skipchars Threads MathConstants searchsortedlast

  hash(x[, h::UInt])

  Compute an integer hash code such that isequal(x,y) implies hash(x)==hash(y). The optional second argument h is a hash code to be mixed with the result.

  New types should implement the 2-argument form, typically by calling the 2-argument hash method recursively in order to mix hashes of the contents with each other (and with h). Typically,
  any type that implements hash should also implement its own == (hence isequal) to guarantee the property mentioned above. Types supporting subtraction (operator -) should also implement
  widen, which is required to hash values inside heterogeneous arrays.

```

If you implement custom hashing, consider using:  
[https://github.com/andrewcooke/AutoHashEquals.jl](https://github.com/andrewcooke/AutoHashEquals.jl)

---

_[View the full topic](https://discourse.julialang.org/t/performance-issues-when-working-with-dict/74565)._
