I'm hoping I can get some advice on optimizing some code.

I have a data structure which is very conveniently represented as a 
Dict{Vector{Int},Vector{Float64}}. That is, I need to look up 
floating-point vectors stored at certain multidimensional (usually 2-10) 
positions represented as a Vector{Int}. Before I construct this Dict, I 
don't have a priori knowledge of what position vectors will be represented.

I'm aware of the problems of using mutable objects as Dict keys, but let's 
assume that's not really an issue.

Profiling reveals that the real time sink is testing arrays for equality 
when indexing into this data structure, and indexing happens very 
frequently. What would be a good way to speed this process up? 

Is there a way to represent the keys which will be cheaper to compare? I 
could convert the keys to tuples, but it's helpful to have them as mutable 
arrays to do some calculations with them at certain points.

Is there a different data structure which might work better? Should I roll 
my own hash table implementation which is particularly optimized for vector 
keys?

Reply via email to