This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ ping: reduce size of cp_token


>>>>> "Mark" == Mark Mitchell <mark@codesourcery.com> writes:

Mark> This patch certainly looks like it should help, because making
Mark> tokens smaller should save memory, and we know GCC performance
Mark> is memory-sensitive.  However, it's always nice to measure.

Mark> I'll pre-approve the patch if you do some plausible measurement of
Mark> your choice that shows that this makes things no worse.

I looked into this.  I rebuilt libstdc++ a number of times both with
and without the patch.

The memory saved by this patch is completely swamped by the memory
wasted due to the buffer reallocation approach in cp_lexer_new_main.
I instrumented this function to print the amount of memory being used.
For smallish compilation units, the default buffer is not filled.
Resizing the buffer also often yields a lot of wasted space.

So, consider this patch withdrawn.  There's no point to it unless the
greater part is dealt with.  FWIW it did not seem to have any
measurable effect on compilation time.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]