[patch] small lexer changes

Matthias Andree matthias.andree at gmx.de
Wed Oct 9 23:27:48 CEST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 08 Oct 2002, Mark M. Hoffman wrote:

> Regarding the size of lexer.c... change "%option full" to "%option ecs" on
> line 305.  That reduces lexer.c from 47596 lines to 4894 lines for me.
> The scanner isn't ready to take advantage of "%option full" anyway, yet.
> If there are no objections, I'll commit that later today.

I benchmarked this, I copied my linux-kernel mailing list mbox file, and
ran lexertest <lexertest.data >/dev/null. I ran five tests and averaged
the results. (Duron 700 with 320 MB RAM).

All figures in seconds.

flexopt user time   system time
full    10.42±0.05  0.16±0.05
ecs     11.73±0.04  0.16±0.03

Here's the program size comparison (stripped, gcc 3.2):
   text    data     bss     dec     hex filename
 104999     364     120  105483   19c0b lexertest-ecs
1481495     364     120 1481979  169cfb lexertest-full

So, the user time increases the processing time by 13% while the program
size decreases by 93%. Looks like a good deal to me.

I'm all in favor of the change.

Matthias
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9pJ9UFmbjPHp/pcMRAkmVAJ9uJy/x9RUazi1lu1avIm0tXAcLYACeN0Pq
e5xKevzto1aZxy6ul5edrCU=
=JxvH
-----END PGP SIGNATURE-----



More information about the bogofilter-dev mailing list