This is the mail archive of the
mailing list for the GCC project.
Re: Expenses of unit-at-a-time (Re: On inlining in C++ with unit-at-a-time code(
> Jan Hubicka <firstname.lastname@example.org> writes:
> | Of course it is possible to construct testcases where unit-at-a-time
> | takes much more memory than normal mode by creating large file
> | consisting of many small funcitons but I tend to believe that this is
> | rare in C and in C++ frontend already deffers most of these so the
> | difference is even smaller.
> I can't parse that.
> It is quite common (in the C++ community) to have large translation
> units with many small functions (usually candidates for inlining).
Yes, however this is the common case where unit-at-a-time helps. In
majority cases I seen there is huge amount of inlining candidates and
relatively few of them are used. unit-at-a-time releases all the
functions bodies that are not needed before assembling causing reduced
memory footprint. Combined with improved inlining heuristics times it
is usually a win for C++. (usually means that I don't know about real
world testcase where it is not but I can construct artificial one for sure)
In gneral unit-at-a-time seems to help more to C++ compile time
performance than C compile times. This is because C++ deferred many
functions anyway getting memory wise the worse of both worlds.
> -- Gaby