long constant list of pairs (was Re: Ways and Build Tags for
Mon, 02 Jun 2003 12:46:21 +0200
> 4. Re: Ways and Build Tags for Optimisation (Ashley Yakeley)
> From: Ashley Yakeley <email@example.com>
> Subject: Re: Ways and Build Tags for Optimisation
> Date: Thu, 29 May 2003 20:40:59 -0700
Sorry for replying from a digest. (Replying from the archive is not
better, is it?)
> Inside the module is an "Array Char String" created from a
> "[(Char,String)]" that is a long list of Unicode character names.
We had very long compilation times when optimization or profiling was
switched on, for a [(String, Int)] list with about 5000 entries.
We worked around the problem by changing the list into a String
(escaping doublequotes) and using "read" to convert it to a list.
(Eventually we converted it to a Map.)
> "MONGOLIAN LETTER MANCHU ALI GALI DDHA"
We had latin1 characters in our strings.
> For some reason, even though only getCharacterName is exported, when
> optimisation is switched on, the interface file balloons a thousandfold:
> $ ls -l UnicodeNames.*hi
> -rw-r--r-- 1 ashley ashley 5854480 May 28 02:49 UnicodeNames.hi
> -rw-r--r-- 1 ashley ashley 5854497 May 28 06:56 UnicodeNames.p_hi
> -rw-r--r-- 1 ashley ashley 2385 May 28 15:59 UnicodeNames.q_hi
> What's the best way to stop this? Is it reasonable to simply switch off
> profiling just for these few files?
> Also, I'd like to make all that data disappear when a binary program
> that doesn't use it is stripped; currently it doesn't. Any ideas?