If you can presume that cljs.core is fixed (AOT, etc),
then its associated source map reading can be heavily
optimized.
This simple optimization "permanently memoizes" its source map, once read. It makes stacktrace printing instantaneous for simple projects, once the first has been printed.
(defn- read-source-map-impl
[f]
(let [smf (io/file (str f ".map"))]
(when (.exists smf)
(sm/decode (json/read-str (slurp smf) :key-fn keyword)))))
(def core-cljs-source-map (atom nil))
(defn read-source-map
"Return the source map for the JavaScript source file."
[f]
(if (.endsWith (str f) "/cljs/core.js")
(swap! core-cljs-source-map (fn [sm] (or sm (read-source-map-impl f))))
(read-source-map-impl f)))