Browse thread
compiling large file hogs RAM and takes a long time.
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jacques Garrigue <garrigue@m...> |
| Subject: | Re: [Caml-list] Re: compiling large file hogs RAM and takes a long time. |
From: Sam Steingold <sds@gnu.org>
> update: the main problem is a polymorphic variant type with 3050
> variants and a function that returns its instances.
> chunking the type, i.e., replacing
> type foo=[|`A|`B|`C|`D]
> with
> type foo_1=[|`A|`B]
> type foo_2=[|`C|`D]
> type foo=[|foo_1|foo_2]
> (but with ~55 variants in ~55 types) did not help.
> Removing the type definition did solve the RAM problem - according to
> top(1), ocamlopt.opt was taking ~80MB, and it compiled the file in about
> 10 minutes.
>
> Any chance there is some quadratic code in polymorphic variant type
> processing?!
There is, and this is a known problem:
http://caml.inria.fr/mantis/view.php?id=4053
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.
Jacques