I believe I described my case poorly, the process to get from one state (key)
to the next is an external (slow) process; the value stored is not the next
state but a value calculated while advancing the state. This dict serves as a
way to quickly skip steps of the external process when it has
Having gotten to an implementation, you are correct, the dict iteration does
not take the lion's share, or at least there are several other steps in my
application which dwarf the dict traversal operations in any case.
I don't think I in practice have a compelling case here, so all I'm left with