Speeding up the analyzer

Description

In working on making Eastwood lint faster, I've come to the conclusion that most of the time is spent analyzing the source files. More specifically, it seems that a significant part of the time is spent in jvm/build-ns-map. which is called from macroexpand-1, here. This is a reasonable approach for the general case, as a macro might alter any ns, but there are many macros in clojure.core which are known to not to this, eg let, defn, etc.

There are several ways of working around this. has done work in core.typed where build-ns-map is elided alltogether, https://github.com/clojure/core.typed/blob/master/module-analyzer-jvm/src/main/clojure/clojure/core/typed/analyzer2/jvm.clj#L85.

Another less elegant solution would be to add a set of known, ns-safe, core macros and avoid calling build-ns-map when expanding those macros.

Would you be open to try to optimize this area of the code, or should I rather monkey-patch the version used in Eastwood?

Environment

None

Status

Assignee

Unassigned

Reporter

Erik Assum

Labels

None

Approval

None

Patch

None

Priority

Minor
Configure