[cvs-nhc98] When lexing, use a perfect hash function to recognise lang

Malcolm Wallace malcolm@sparud.net
Tue, 22 Jan 2002 12:02:50 +0100 (CET)


malcolm: Tue Jan 22 12:02:50 CET 2002

Update of /usr/src/master/nhc/src/compiler98
In directory hinken:/tmp/cvs-serv25512

Modified Files:
	LexLow.hs 
Log Message:
When lexing, use a perfect hash function to recognise language
keywords, rather than the previous chained conditionals.  This makes
the compiler approx 2% faster when built with nhc98 - there is no
discernible effect on performance when built with ghc.  Nevertheless
I'm committing the change, because on a full build of nhc98 with itself
the 2% speedup totals to about 10 minutes saving.