Related articles |
---|
What does it mean to "move characters" in the lexer? costello@mitre.org (Roger L Costello) (2022-06-21) |
Re: What does it mean to "move characters" in the lexer? gah4@u.washington.edu (gah4) (2022-06-21) |
Re: What does it mean to "move characters" in the lexer? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-06-22) |
Re: What does it mean to "move characters" in the lexer? 480-992-1380@kylheku.com (Kaz Kylheku) (2022-06-22) |
Re: What does it mean to "move characters" in the lexer? 480-992-1380@kylheku.com (Kaz Kylheku) (2022-06-22) |
Re: What does it mean to "move characters" in the lexer? tkoenig@netcologne.de (Thomas Koenig) (2022-06-22) |
From: | Kaz Kylheku <480-992-1380@kylheku.com> |
Newsgroups: | comp.compilers |
Date: | Wed, 22 Jun 2022 01:13:50 -0000 (UTC) |
Organization: | A noiseless patient Spider |
References: | 22-06-057 22-06-058 22-06-064 |
Injection-Info: | gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="24599"; mail-complaints-to="abuse@iecc.com" |
Keywords: | lex, performance |
Posted-Date: | 21 Jun 2022 21:48:10 EDT |
On 2022-06-21, Christopher F Clark <christopher.f.clark@compiler-resources.com> wrote:
> While worrying about copying characters around in compilers isn't given
> much thought these days, it is very relevant to people implementing
> networking software and also those doing hardware accelerators and their
> device drivers.
Don't write off buffering optimization'sn as yesterday's game just yet;
e.g. this could still be relevant to someone needing to parse gigabytes
of JSON or XML. Or maybe even just megabytes.
I remember reading some article some years ago whereby some Javascript
programmer discovered it was faster to read JSON from a file using
dedicated JSON routines available in Javascript, than to declare the
same syntax in the Javascript program as a literal and let it be
scanned along with the program and available to it that way.
(I realize there may be other reasons for the performance difference,
because JSON isn't Javascript, but likely part of it was that the JS
implementation didn't care about being efficient for large amounts of
data: the "hot spot" isn't going to be the scanning stage that takes
place oncem before the program has a chance to execute any sort of
loop.)
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Return to the
comp.compilers page.
Search the
comp.compilers archives again.