Related articles |
---|
[24 earlier articles] |
Re: Alternative C compilers on x86_64 Linux? bc@freeuk.com (BartC) (2016-09-29) |
Re: Alternative C compilers on x86_64 Linux? gneuner2@comcast.net (George Neuner) (2016-09-29) |
Re: Alternative C compilers on x86_64 Linux? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2016-09-30) |
Re: Alternative C compilers on x86_64 Linux? arnold@skeeve.com (2016-09-30) |
Re: Alternative C compilers on x86_64 Linux? bc@freeuk.com (BartC) (2016-09-30) |
Re: Alternative C compilers on x86_64 Linux? bc@freeuk.com (BartC) (2016-09-30) |
Re: Alternative C compilers on x86_64 Linux? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2016-09-30) |
Re: Alternative C compilers on x86_64 Linux? bc@freeuk.com (BartC) (2016-10-01) |
Re: Alternative C compilers on x86_64 Linux? bc@freeuk.com (BartC) (2016-10-17) |
From: | Hans-Peter Diettrich <DrDiettrich1@netscape.net> |
Newsgroups: | comp.compilers |
Date: | Fri, 30 Sep 2016 20:15:30 +0200 |
Organization: | Compilers Central |
References: | 16-09-001 16-09-033 16-09-034 16-09-035 16-09-037 16-09-042 16-09-044 16-09-047 |
Injection-Info: | miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="93896"; mail-complaints-to="abuse@iecc.com" |
Keywords: | C, performance |
Posted-Date: | 01 Oct 2016 15:07:18 EDT |
BartC schrieb:
> On 30/09/2016 04:03, Hans-Peter Diettrich wrote:
>> BartC schrieb:
>>> (I can tokenise C source code at some 10M lines per second on my PC ...
>>
>> IMO it's not the header files, which slow down compilation, but the
>> preprocessor macros which require to look up and optionally expand every
>> token. ...
>
>> In so far I don't think that it's fair or
>> meaningful to compare a full blown compiler with a bare tokenizer.
>
> I seem to remember some comment in this group that tokenising accounts
> for a big chunk of a compiler's runtime (50% or something).
This seems to be a reasonable figure for C, including all those nasty
tasks which have to be done before a token can be passed on to the parser.
> While it is true that doing a full compile will take longer than just
> raw tokenising, should that factor be of the order of 1000 times longer,
> or three magnitudes?
Find out yourself. Replace the grammar of your tokenizer by the C
grammar, and test again. I'd wonder if it would not reach the speed of
your tokenizer. Then add the preprocessor with file inclusion, macro
definition, recognition and expansion, conditional compilation, and test
again. Then add Ansi and Unicode string literals and symbol tables, and
test again.
DoDi
Return to the
comp.compilers page.
Search the
comp.compilers archives again.