Comment made by: mfikes
We are currently emitting source map line/col information for every AST, regardless of op type. While this guarantees that we have comprehensive source mapping information, it may be a much larger set than we need for many common uses.
Some op types can clearly be omitted, like {{:no-op}} for example. With a little experimentation, you can see that source mapping for the limited purpose of mapping stack traces is possible with just two or three op types. Dirac DevTools makes more extensive use of source mapping information in order to properly identify locals, binding forms, etc. within the source code.
The attached patch limits source map line/col emission to those tags which are needed for stack trace mapping, and for some simple uses with Dirac (which is a superset of those needed for stack trace mapping). The fundamental problem with this strategy is identifying the right subset of ops for which we emit line/col information.
But, this might be worth it if we can successfully identify a minimal set that meets general needs. With the attached patch, we get a 12% performance boost relative to current master when compiling Coal Mine in non-parallel mode.
With this patch, the size of the source maps written to disk are smaller: For {{cljs.core}} it is 432567 bytes instead of 640411 bytes.
Attaching this patch for feedback. If we can find a suitable subset, this might work out. If this proves too difficult, perhaps a compiler option could be introduced to control whether we emit a a tiny subset sufficient for stack trace mapping or slightly larger for debugging (Dirac), or all ops.