So I've been trying to see if I could speed up the pidigits program, and, well, failed. I'm not alone though, Stephen Blackheath and others have tried too, and no one's managed to make things much, if at all faster.
The main problem seems to be that GHC is allocating a lot of RAM, which must be related to the need for Integers. The current program uses up 500+MB by the time it finishes. Not good.
So, I'm putting a call out to see if anyone else can either think of a better way to get the answer than the current entry, or any tips about reducing memory usage. If you come up with anything, I'd love to hear from you.
Cheers, ~ Axman

The current entry takes 95s on my machine (compared to the 10s on theirs), but it only takes 3Mb. What am I missing?
[0] wren@xenobia:~/test $ ghc --make -O2 -optc-O3 pidigits.hs -o pidigits
[1 of 1] Compiling Main ( pidigits.hs, pidigits.o )
Linking pidigits ...
[0] wren@xenobia:~/test $ ./pidigits 10000 +RTS -sstderr >/dev/null
./pidigits 10000 +RTS -sstderr
18,720,889,112 bytes allocated in the heap
5,614,688 bytes copied during GC (scavenged)
3,493,808 bytes copied during GC (not scavenged)
327,680 bytes maximum residency (635 sample(s))
34235 collections in generation 0 ( 0.50s)
635 collections in generation 1 ( 0.04s)
3 Mb total memory in use
INIT time 0.00s ( 0.02s elapsed)
MUT time 94.93s ( 97.81s elapsed)
GC time 0.54s ( 0.64s elapsed)
EXIT time 0.00s ( 0.00s elapsed)
Total time 95.47s ( 98.47s elapsed)
%GC time 0.6% (0.7% elapsed)
Alloc rate 197,202,546 bytes per MUT second
Productivity 99.4% of total user, 96.4% of total elapsed
That was using GHC 6.8.2, btw. Maybe this is one of the regressions that GHC 6.10 has...