Sun, 22 Aug 1999 03:39:11 +0200, Michael Weber <[EMAIL PROTECTED]> 
pisze:

> *hmm* this works with ghc-4.04 of 1999/08/03 on Linux, but I had to increase
> stack size, i.e.
>       ./fmtest +RTS -K2M

Ah, thanks. Surprisingly, with 10000 elements and 4.04 it needs at
least -K4M, but with 4.02 it crashes no matter how much is given
(I guess it reaches some hard maximum).

> Also, I have a project that generates big finite maps (50000+
> elements, ~30M mem) and had never problems with that (on Solaris
> and Linux)...

Maybe it matters that your project does not build the map from one
huge list? I looked at addListToFM_C and I guess that foldl is what
needs this stack, and only because it is lazy, am I right? Could it
be written so it does not need so much stack (with no bad consequences
arising from losing laziness)?

What is better: to build a set from one list or to build independent
sets and join them using Set.union? The sets are joined from small
parts (most are empty, sometimes singletons), the parts are combined
into larger parts and so on, but not many levels. I used the common
trick to join [Element]->[Element] by (.) and `mkSet (combined [])'
at the end, to avoid ++'s walking along the same list multiple
times. Maybe it would be better to union sets from the beginning,
but I thought that unions of mostly emptySets could be slower than
(.)'s of mostly identity functions.

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://kki.net.pl/qrczak/
 \__/          GCS/M d- s+:-- a22 C+++>+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-

Reply via email to