<div dir="ltr">Hello,<div><br></div><div>Recently Jonathan Blow posted a short screencast discussing build time of his compiler with when no optimizations are run on the user's code.</div><div><br></div><div>Part 1: <a href="https://www.youtube.com/watch?v=HLk4eiGUic8">https://www.youtube.com/watch?v=HLk4eiGUic8</a></div><div>Part 2: <a href="https://www.youtube.com/watch?v=mIjGYbol0O4">https://www.youtube.com/watch?v=mIjGYbol0O4</a></div><div><br></div><div>He discusses what parts are taking the longest to compile, and the ultimately shows this:</div><div><a href="http://i.imgur.com/BkbKcJK.png">http://i.imgur.com/BkbKcJK.png</a></div><div>...which shows that emitting LLVM IR in memory and LLVMTargetMachineEmitToFile is the bottleneck in his compiler toolchain.</div><div><br></div><div>In fact, it was significantly faster to emit C to disk and compile with MSVC than to emit LLVM in memory and call LLVMTargetMachineEmitToFile.</div><div><br></div><div>His conclusion is that he will not depend on LLVM when his users compile with optimizations off, instead directly emitting x86_64 machine code into an object file.</div><div><br></div><div>Needless to say, this is duplicate effort. Is there any way the LLVM project could speed things up when no optimizations are run?</div><div><br></div><div>As another compiler author (<a href="http://ziglang.org/">http://ziglang.org/</a>), I want to compete with Jon's speed without having to duplicate the effort that LLVM already solves.</div><div><br></div><div>Thanks for your time.</div><div>Andrew</div></div>