Re: How can the speed of a scanner be independent of the number of rules?

Roger L Costello <costello@mitre.org>
Thu, 24 Mar 2022 11:53:31 +0000

          From comp.compilers

Related articles
| List of all articles for this month |
From: Roger L Costello <costello@mitre.org>
Newsgroups: comp.compilers
Date: Thu, 24 Mar 2022 11:53:31 +0000
Organization: Compilers Central
References: 22-03-047 22-03-048
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="71525"; mail-complaints-to="abuse@iecc.com"
Keywords: lex, performance, comment
Posted-Date: 24 Mar 2022 13:39:29 EDT
Content-Language: en-US

Kaz Kylheku wrote:


> suppose we have some existing scanner with 10 rules,
> which correctly tokenizes an input. Then suppose we
> add 990 rules to it. None of these rules take precedence
> over the 10 rules, and so the the input is handled by the
> same rules.


Ouch!!!


Such a letdown. So the statement "adding rules does not slow down the scanner"
really isn't remarkable or awesome. Add 990 more irrelevant rules, and the
scanner operates just as fast. Big deal.


Thanks Kaz.


/Roger
[But see other messages -- adding 990 more relevant rules doesn't slow it down either. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.