Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
compiling large file hogs RAM and takes a long time.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sam Steingold <sds@g...>
Subject: Re: compiling large file hogs RAM and takes a long time.
Hash: SHA1

Jacques Garrigue wrote:
>>> Any chance there is some quadratic code in polymorphic variant type
>>> processing?!
>> There is, and this is a known problem:
>> I'm sorry, but I don't see any easy way out.
>> At least on the basic time complexity.
>> However, the space complexity could be improved, if I find what is
>> gobbling memory so fast.
> I found the reason, and this is now fixed in CVS 3.10.
> I can now compile a pattern matching with 3000 cases in 10s and just
> 10MB, which is better than 40s and 250MB before :-)

I observe a time reduction of 40% (from 10 minutes down to 6 minutes)
and RAM usage reduction of 60% (from 450MB down to 160MB)
for my (generated) file.
Very nice, thanks!

> This doesn't change the quadratic time complexity, but as other
> mentioned, constants do matter.

Indeed, but it appears that in this case improving constants does not
solve the problem completely.

Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -