I have implemented an __A* search algorithm__ for finding the *shortest* path between two states. The algorithm uses a hash-map for storing best-known distances for visited states. And one hash-map for storing child-parent relationships needed for reconstruction of the shortest path.

__Here__ is the code. Implementation of the algorithm is generic (states only need to be "hashable" and "comparable") but in this particular case states are pairs (vectors) of ints [x y] and they represent one cell in a given heightmap (__cost__ for jumping to __neighboring cell__ depends on the difference in heights).

Question is whether it's possible to improve performance and how? Maybe by using some features from 1.2 or future versions, by changing the logic of the algorithm implementation (e.g. using a different way to store path) or changing state representation in this particular case?

__Java implementation__ runs in an instant for __this map__ and Clojure implementation takes about 40 seconds. Of course, there are some natural and obvious reasons for this: dynamic typing, persistent data structures, unnecessary (un)boxing of primitive types...

Using transients didn't make much difference.