Created
January 21, 2010 18:53
-
-
Save angerman/283066 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (def & comp) | |
| (def p partial) | |
| (def $ apply) | |
| (def kws (map (& keyword str) (seq "abcdefghijklmnopqrstuvwxyz"))) | |
| (defn items [] | |
| (for [i (range 10000)] | |
| ($ merge (for [kw kws] {kw i})))) | |
| (def head ($ merge (for [kw kws] {kw []}))) | |
| (time (doall ($ (p merge-with conj head) | |
| (items)))) | |
| (def t-head ($ merge (for [kw kws] {kw (transient [])}))) | |
| (time (doall ($ merge (map (fn [[k v]] {k (persistent! v)}) | |
| ($ (p merge-with conj! t-head) | |
| (items)))))) | |
| ;;-> Transient used by non-owner thread | |
| ;; [Thrown class java.lang.IllegalAccessError] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment