Align equiv/equals semantics to core PMs and improve performance

Description

Problem

int-map equality (both equiv/equals) is currently defined slightly
differently to persistent maps in core. The current implementation has
(slightly) different semantics, but very different performance
characteristics.

The performance charactertistics of the current implementation made it
unusable for us in a case where we need test larg-ish maps (> 50k
keys) for equality.

Proposed fix

The attached patch aligns the equiv/equals implementations with those
of APersistentMap, see:
equals: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L48
equiv: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L73

Benchmarks

The patch adds the following benchmarks, comparing two different (as
in not identical?) but equivalent int-maps with 1e6 elements, for both
int-map and hash-map. This is the worst case scenario, as each map
entry needs to be compared.

Before:

hash-map, for comparison:

After (patch 0003):

After (patch 0004):

Environment

None

Assignee

Zach Tellman

Reporter

Ragnar Dahlén

Labels

None

Approval

None

Patch

Code

Priority

Major
Configure