Improve compile time and executable size by counting lines of LLVM IR

Interesting.. I guess that means the code uses collect in a bunch of places and then never mutates the map again, which isn't all that surprising. Your observation about inlining is probably correct, though it does mean that llvm-lines will attribute a bunch of IR to a slightly misleading function. In the sense that it'll show more IR for the calling function, rather than counting it as more monomorphizations of the inner function. But that's likely hard to fix...

Thanks for the .ll command. It'd be handy to have this plus the rg command listed in the tool README. How did you trace the IR back to the callsite though — it doesn't look like this information is in the .ll file afaict?

Does the #[inline(never)] on resize also prevent it from being instantiated in std at all? The rest of that collect...insert sequence might already be codegen'ed in the library, leaving resize out in the #[cold]...