Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> i know full well how much time is spent parsing these things and how the mechanism works - i don't believe this proposal will actually improve that.

Well, then you're pretty much 100% wrong in most C++ projects.

I honestly don't know what to tell you here. That persisting header ASTs between translation units is faster than re-parsing should be trivially obvious, and if it isn't trivially obvious, then the mere fact that precompiled headers and ccache dramatically speeds up builds ought to make it empirically obvious.

The facts just aren't on your side.

> namely that whatever preprocessed import module thing is created, it still has to be included into the compilation unit somehow

Well, yes, obviously. In the current model the compiler slurps the header into the source file, and parse the entire combination, resulting in the parse tree of the header + the parse tree of the rest of the file. In the proposed model the compiler pulls the parse tree of the header out of cache and just builds the parse tree of the file. Since in C++ header parse trees are often quite expensive to build (since template declarations have to live in the headers and their parse trees are incredibly expensive to build), this ought to be a blindingly obvious win.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: