[CLJ-1239] faster, more flexible dispatch for clojure.walk Created: 29/Jul/13 Updated: 23/Nov/13
|Reporter:||Stuart Sierra||Assignee:||Stuart Sierra|
|Patch:||Code and Test|
The conditional dispatch in clojure.walk is slow and not open to extension. It also doesn't support records; see
Current patch: 0001-CLJ-1239-protocol-dispatch-for-clojure.walk.patch reimplements clojure.walk using protocols.
The public API is unchanged, but walk gains support for records. Users can extend the walk protocol to other collection types if desired.
This patch supersedes
See https://github.com/stuartsierra/clojure.walk2 for benchmarks. My tests indicate it is roughly 2x the speed of the original clojure.walk.
This approach carries more risk of breaking user code than the patch in
|Comment by Vjeran Marcinko [ 19/Oct/13 12:32 PM ]|
It looks, as it is now, that walking the tree and replacing forms doesn't preserve original meta-data contained in data structures.
|Comment by Andy Fingerhut [ 23/Nov/13 1:11 AM ]|
Patch 0001-CLJ-1239-protocol-dispatch-for-clojure.walk.patch no longer applies cleanly to latest Clojure master since the patch for
|Comment by Alex Miller [ 23/Nov/13 1:52 AM ]|
This patch and ticket are still candidates for future release.