[fpc-devel] Comparison FPC 2.6.2 - Delphi 7
Marco van de Voort
marcov at stack.nl
Tue Mar 5 11:42:09 CET 2013
In our previous episode, Henry Vermaak said:
> > IMHO a threading clusterfsck is preferable to a forking clusterfck :-)
>
> My gut feeling would be that the complexity and potential bugs/races
> don't make up for the speed, but maybe a threaded compiler gains a lot
> more than I imagine. Are there any multi-threaded compilers around for
> comparison?
Not the normal free ones. But that is not really a metric, but none of them were designed for modular
languages, stronger, they don't even use features like precompiled headers
that commercial ones already have for a long time.
Note that strictly only the part of make *must* be multithreaded, the
compilation of a compilation unit is basically the current single threaded
compiler running in its own thread.
So the parts that decide which compilation unit must be loaded, and parts of
the unit loader.
I think the problem is more doing it in a non-trivial production compiler,
than the principle itself.
> > This means you need to manually specify in the build system which
> > compilation unit depends on which headers. And this is also why in C/C++
> > inline functions are in the header, so that this model is persistent, since
> > most builds are not full, but incremental.
>
> As you probably know, you can use -MD and variants with gcc, which
> outputs dependency files for make, that you then include in the
> Makefile.
No, but I did know other tools for that yes. Compiler output is better of
course.
> If you add, e.g. -MMD to the CFLAGS, these dependencies are
> generated as a side effect of the compilation process, so it's not a
> separate step. As a result, partial builds work really well, and can be
> parallelized as usual. No manual work involved.
Maybe that works for FPC too. But FPC can currently compile units multiple
times afaik. (to detangle circular references), FPC afaik also registers
some preprocessor state, and compiles on change.
So basically make is meant for a different execution model IMHO, and it
shouldn't be made a cornerstone. It is only a stopgap till we have something
that fits with the unit system.
More information about the fpc-devel
mailing list