Skip to content

Instantly share code, notes, and snippets.

@newfoundresearch
Created December 28, 2011 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save newfoundresearch/1525702 to your computer and use it in GitHub Desktop.
Save newfoundresearch/1525702 to your computer and use it in GitHub Desktop.
(defn t2 [ks]
(persistent!
(reduce
(fn [m k]
(assoc! m k (* k 2)))
(transient {})
ks)))
(def m (t2 (range 1 1e6)))
OutOfMemoryError Java heap space clojure.lang.PersistentHashMap$BitmapIndexedNode.assoc (PersistentHashMap.java:678)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment