public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Devang Patel <dpatel@apple.com>
To: Daniel Berlin <dberlin@dberlin.org>
Cc: gcc@gcc.gnu.org
Subject: Re: TREE_CODE mania
Date: Wed, 04 Sep 2002 10:19:00 -0000	[thread overview]
Message-ID: <849C4B5D-C02A-11D6-9FC4-00039362EF82@apple.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0209032345550.494-100000@dberlin.org>

[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]


On Tuesday, September 3, 2002, at 08:51 PM, Daniel Berlin wrote:

> On Tue, 3 Sep 2002, Devang Patel wrote:
>
>> Hi All,
>>
>> Recently there was a discussion about faster compile time. And
>> memory usage and/or allocation is considered one probable
>> culprit behind the slow compiler.
>>
>> To understand actual memory usage pattern, I instrumented GCC
>> by replacing TREE_CODE macro with function TREE_CODE_read().
>> I just wanted to see what is the usage pattern and how bad/good is it.
>>
>> I collected profiled data for following one line program.
>>
>> int foo() { return 1;}
>>
>> Now, gprof tells me that to compile this, cc1 calls TREE_CODE_read()
>> 37572 times! I was expecting that number to be in couple of thousands
>> range but 37k seems high to me.
>>
>> I think, such a high number of indirect memory references puts
>> high  pressure on VM and GCC's memory manager to maintain locality.
>
> Which it doesn't.
> Can't we attack this problem directly?
> By maybe using object based bins rather than size based ones, at least 
> for
> trees and RTL?

Sure, we can try using different allocation schemes to achieve better 
compile
time performance. But this approach is like -- earn more money and 
allocate
funds in better way to meet the budget. I am thinking in terms, can we 
reduce
expenditure ? I think, we need to work in both direction to achieve 
better
compile time speedup.

-Devang

[-- Attachment #2: Type: text/enriched, Size: 1410 bytes --]



On Tuesday, September 3, 2002, at 08:51 PM, Daniel Berlin wrote:


<excerpt>On Tue, 3 Sep 2002, Devang Patel wrote:


<excerpt>Hi All,


Recently there was a discussion about faster compile time. And

memory usage and/or allocation is considered one probable

culprit behind the slow compiler.


To understand actual memory usage pattern, I instrumented GCC

by replacing TREE_CODE macro with function TREE_CODE_read().

I just wanted to see what is the usage pattern and how bad/good is it.


I collected profiled data for following one line program.


int foo() { return 1;}


Now, gprof tells me that to compile this, cc1 calls TREE_CODE_read()

37572 times! I was expecting that number to be in couple of thousands

range but 37k seems high to me.


I think, such a high number of indirect memory references puts

high  pressure on VM and GCC's memory manager to maintain locality.

</excerpt>

Which it doesn't.

Can't we attack this problem directly?

By maybe using object based bins rather than size based ones, at least
for 

trees and RTL?

</excerpt>

Sure, we can try using different allocation schemes to achieve better
compile

time performance. But this approach is like -- earn more money and
allocate 

funds in better way to meet the budget. I am thinking in terms, can we
reduce

expenditure ? I think, we need to work in both direction to achieve
better

compile time speedup.


-Devang


  reply	other threads:[~2002-09-04 17:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-03 20:18 Devang Patel
2002-09-03 20:50 ` Daniel Berlin
2002-09-04 10:19   ` Devang Patel [this message]
2002-09-04 16:04     ` Daniel Berlin
2002-09-04 19:51       ` Devang Patel
2002-09-04 10:23   ` Devang Patel
2002-09-04  1:51 ` Neil Booth
2002-09-04 10:15   ` Devang Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=849C4B5D-C02A-11D6-9FC4-00039362EF82@apple.com \
    --to=dpatel@apple.com \
    --cc=dberlin@dberlin.org \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).