Path: csiph.com!feeder.erje.net!1.us.feeder.erje.net!news.glorb.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Hans-Peter Diettrich Newsgroups: comp.compilers Subject: Re: Alternative C compilers on x86_64 Linux? Date: Fri, 30 Sep 2016 20:15:30 +0200 Organization: Compilers Central Lines: 30 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <16-10-001@comp.compilers> References: <16-09-001@comp.compilers> <16-09-033@comp.compilers> <16-09-034@comp.compilers> <16-09-035@comp.compilers> <16-09-037@comp.compilers> <16-09-042@comp.compilers> <16-09-044@comp.compilers> <16-09-047@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com X-Received-Bytes: 2506 X-Received-Body-CRC: 2359268076 Xref: csiph.com comp.compilers:1788 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