Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce the z/sexpr cost in find-namespace
This patch addresses the slowdown introduced between 0.6.4 and 0.6.5 and fixes weavejester#181. Prior to this patch, find-namespace and ns-form? called z/sexpr on all traversed forms. The find-namespace logic needed only parts of resulting sexprs. The cost of z/sexpr was non-negligible when invoked on complex forms. As a result, z/sexpr and nested functions dominated the CPU cost of the indentation logic. This patch makes z/sexpr calls more fine-granular and avoids invoking the function on nodes irrelevant to find-namespace. This results in a tenfold speedup.
- Loading branch information