4 ms·
> The compiler is part of the IDE, not some external process that needs to start from a blank state for each file, needing to read the same files over and over.
by tossaway1 10y ago
> The compiler is part of the IDE, not some external process that needs to start from a blank state for each file, needing to read the same files over and over...
I suspect the difference is negligible in practice. In both cases, the files are likely to be cached in memory after they're read the first time, so you're not really reading it over and over.
- setpatchaddress 10y agoYou're forgetting about dependency management. The win for in-ram cache on incremental builds is real.
- badsectoracula 10y agoProbably, but it can be a convenience to make some small modifications to try out things without saving them. From a performance standpoint the win comes from not having the compiler start from a blank state for each file but keep the compiled objects in memory and only update the changed files. I suppose a modern reimplementation of that idea (that has more memory to spare, after all the official BC++5 requirements were 16MB of RAM) would be able to have a more fine-grained approach.
- leni536 10y agoWell, a more fine-grained approach would be a compiler-server with a fine grained API. https://gcc.gnu.org/wiki/IncrementalCompiler https://gcc.gnu.org/wiki/IncrementalCompiler https://www.reddit.com/r/cpp/comments/59n8ya/what_happened_to_clang_server/ https://www.reddit.com/r/cpp/comments/59n8ya/what_happened_t... I don't know how much effort is poured into these projects. There are some clang based servers like ycmd and rtags, but these are used for linting, refactoring and search (so no incremental compilation).
- badsectoracula 10y agoTBH i was thinking more in the lines of having the text editor associate source code lines with C functions and declarations so that the IDE can recompile only the bits changed while working in the code (something like a more advanced edit-and-continue). But yeah, i do not see much effort going on in improving these areas. I think people are just used to "patchwork IDEs" and find them good enough.
- gpderetta 10y ago> Probably, but it can be a convenience to make some small modifications to try out things without saving them. Yes, I remember it being very pleasant when borland C++ crashed after running your application, losing your unsaved work. edit: that was on windows 95/98 time; so it is more likely that the application crashed the whole OS.
- badsectoracula 10y agoIt sucked when that happened, which is how i developed a habit for saving my files even when i'm doing nothing and even pressing the save shortcut key several times :-P. But at the same time it can be a convenience if you dont want to save but instead make a small change to try something out.