From: "Oliver Kellogg" <oliver.kellogg@t-online.de>
Subject: Re: GPS - A new kind of IDE?
Date: Sat, 15 Feb 2003 23:08:34 +0100
Date: 2003-02-15T23:08:34+01:00 [thread overview]
Message-ID: <b2mdin$5gb$04$1@news.t-online.com> (raw)
In-Reply-To: b298nr$9c$06$1@news.t-online.com
I need to correct myself on the data that I posted.
I was just about to switch from ANTLR to GNAT for disappointment
with the ANTLR parser speed when it occurred to me that I had been
compiling the ANTLR C++ runtime and the Ada grammar without -O
(optimize.)
After turning on -O, I've had quite a surprise.
Here are the timing figures (test case: Ada files of polyorb-snap-4566/src)
Without -O for runtime and lexer/parser:
real 2m41.298s
user 2m39.200s
sys 0m0.860s
With -O for runtime and lexer/parser:
real 0m9.895s
user 0m8.250s
sys 0m0.890s
For comparison, "gnatgcc -c -gnats" (which is roughly
comparable in effect to what the above parser does)
performs as follows:
real 0m4.042s
user 0m2.030s
sys 0m2.010s
So in this case the hand crafted parser (GNAT) is still
double as fast as the parser automatically generated
from a grammar (ANTLR.) Not bad IMHO.
Oliver Kellogg wrote:
> I've just bumped into an interesting data point on
> parser contruction with ANTLR regarding parse speed.
> ANTLR supports syntactic predicates such as
>
> (subprog_body) => subprog_body
>
> where the rule subprog_body is applied on trial
> and if it turns out not to apply then the parser backs
> out and applies the next rule. Terence Parr, inventor
> of ANTLR, calls this "infinite lookahead".
>
> This feature makes for a prettier grammar because
> it allows more liberal reuse of rules. In the above
> example, we can write the subprog_body rule in a
> place where also a subprog_spec could be expected;
> the parser takes care of resolving the ambiguity.
>
> However, that beauty has its price.
>
> As a test, I submitted the source code of the
> Ada Graphics Package (agp95_v0.1_x11/src) to parsing
> (38560 LOC, 11851 executable semicolons.)
>
> With usage of syntactic predicate for the subprog_spec/subprog_body
> distinction ("pretty" soft-state grammar rule):
>
> real 1m16.635s
> user 1m15.930s
> sys 0m0.300s
>
> Without usage of syntactic predicate for the subprog_spec/subprog_body
> distinction ("ugly" hard-coded state):
>
> real 0m46.058s
> user 0m45.110s
> sys 0m0.370s
>
> So for kdevelop adasupport I'm going with the hard state rule
> for subprograms.
>
next prev parent reply other threads:[~2003-02-15 22:08 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-08 9:02 GPS - A new kind of IDE? Oliver Kellogg
2003-02-08 10:30 ` Preben Randhol
2003-02-11 1:24 ` Oliver Kellogg
2003-02-15 22:08 ` Oliver Kellogg [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-05-10 18:41 Alexandre E. Kopilovitch
[not found] <000001c1f762$aed14310$7201a8c0@bacus>
2002-05-09 14:15 ` Mário Amado Alves
2002-05-02 2:59 GNAT Programming System - Wow Steve Doiel
2002-05-05 19:35 ` Per Sandbergs
2002-05-06 9:58 ` Preben Randhol
2002-05-06 21:52 ` Robert Dewar
2002-05-07 10:11 ` Preben Randhol
2002-05-07 11:30 ` GPS - A new kind of IDE? John McCabe
2002-05-08 2:34 ` Robert Dewar
2002-05-08 7:49 ` Martin Dowie
2002-05-08 10:40 ` Preben Randhol
2002-05-08 8:17 ` John McCabe
2002-05-08 8:34 ` Martin Dowie
2002-05-08 10:57 ` Preben Randhol
2002-05-08 13:59 ` Wes Groleau
2002-05-09 14:06 ` Mário Amado Alves
2002-05-09 14:06 ` Mário Amado Alves
2002-05-10 2:22 ` Richard Riehle
2002-05-10 8:38 ` Preben Randhol
2002-05-10 10:39 ` Peter Hermann
2002-05-10 14:13 ` Stephen Leake
2002-05-10 14:52 ` David C. Hoos
2002-05-10 15:48 ` Marin David Condic
2002-05-11 12:39 ` Robert Dewar
2002-05-12 19:12 ` James Ross
2002-05-12 21:21 ` Preben Randhol
2002-05-10 15:46 ` Robert Dewar
2002-05-10 16:04 ` Mário Amado Alves
2002-05-11 0:44 ` Richard Riehle
2002-05-14 9:07 ` John McCabe
2002-05-14 13:00 ` Larry Kilgallen
2002-05-10 13:16 ` Robert Dewar
2002-05-10 13:19 ` Robert Dewar
2002-05-10 14:18 ` Stephen Leake
2002-05-10 15:18 ` Rajat Datta
2002-05-14 9:09 ` John McCabe
2002-05-14 14:16 ` Robert Dewar
2002-05-14 16:24 ` John McCabe
2002-05-14 15:22 ` Ted Dennison
2002-05-10 15:34 ` Arnaud Charlet
2002-05-10 16:32 ` Preben Randhol
2002-05-10 13:22 ` Marin David Condic
2002-05-13 14:56 ` Ted Dennison
2002-05-11 10:34 ` Florian Weimer
2002-05-11 10:34 ` Florian Weimer
2002-05-13 13:06 ` Georg Bauhaus
2002-05-14 15:31 ` Ted Dennison
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox