This is the mail archive of the gcc@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]

RE: Precompiled headers (or other speed ups)



><<  Well, only really surprising if you assume the parsing code is well
>written :-) After all, the mid/backend is mostly doing memory-memory
>transforms on the trees, and that's going to run as fast as your cache
>and cpu can handle.  Parsers, OTOH, have to I/O.  Badly written parsers
>might even use c stdio functions to fgetc the entire file one char at a
>time....
>>>
>
>Sure, but that presumably is an easy thing to fix. In GNAT, the entire
>file is read with a single read, and then all access to the file is to
>the in memory copy, which stays around throughout the compilation.

  Oh yeah; I was just suggesting it wouldn't be *surprising*, not that it
would be 'right'!  Last time I looked at bison (or was it lex or yacc? I
forget) was around '95 and it did tend to turn out fairly sucky code (in
terms of f-stdio) if you didn't know what you were doing and how to hook
it into a memory buffer.  I haven't looked at the gcc parsers yet but I
would hope that they don't have such obvious design flaws.....

  Another thing that could eat time in a parser would be if there were
numerous shift-reduce conflicts that caused a lot of backtracking on fairly
common constructs.  That's just a for-example also :)

    DaveK

-- 
The Boulder Pledge: "Under no circumstances will I ever purchase anything 
offered to me as the result of an unsolicited email message. Nor will I 
forward chain letters, petitions, mass mailings, or virus warnings to large 
numbers of others. This is my contribution to the survival of the online
community." 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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