Re: hash comparison

2013-11-28 Thread Mark Engelberg
If two objects are identical (actually point to the same slot in memory), they can immediately be determined to be equal. There are also some ways to quickly determine that things are definitely not equal. For example, two vectors with different sizes are not equal. As you've pointed out, if the

Re: hash comparison

2013-11-28 Thread Cedric Greevey
Presumably it then compares the objects element by element. If the common case is for the arguments to (= x y) to be unequal with unequal hashes, though, this is still considerably faster. On Thu, Nov 28, 2013 at 5:03 PM, Andy Smith wrote: > Hi, > > I heard Rich Hickey talking about how identity

hash comparison

2013-11-28 Thread Andy Smith
Hi, I heard Rich Hickey talking about how identity in clojure is synonymous with value-based tests of equality. To make this efficient he describes that objects store cached hashes that are used to speed up these tests of equality, so clojure isnt comparing every data member of a complex data