title: Difference between two maps
body: <p>I need to very efficiently compare two maps in Clojure/Java, and return the difference as determined by Java's .equals(..), with nil/null equivalent to "not present".</p>
  
  <p>i.e. I am looking for the most efficient way to a write a function like:</p>
  
  <pre><code>(map-difference
    {:a 1, :b nil, :c 2, :d 3}
    {:a 1, :b "Hidden", :c 3, :e 5})
  
  =&gt; {:b nil, :c 2, :d 3, :e nil}
  </code></pre>
  
  <p>I'd prefer an immutable Clojure map as output, but a Java map would also be fine if the performance improvement would be significant.</p>
  
  <p>For what it's worth, my basic test case / expectation of behaviour is that the following will be equal (up to the equivalence of null = "Not present") for any two maps a and b:</p>
  
  <pre><code>a 
  (merge b (difference a b))
  </code></pre>
  
  <p>What would be the best way to implement this?</p>