Browse thread
compiling large file hogs RAM and takes a long time.
-
Sam Steingold
- Sam Steingold
- skaller
- Sam Steingold
[
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: | Sam Steingold <sds@g...> |
| Subject: | large parametrized polymorphic variant type combinations take forever to compile |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
continuing the saga started in
http://permalink.gmane.org/gmane.comp.lang.caml.inria/37496
I have 3 files: f1.ml, f2.ml, and f.ml:
=== f1.ml ===
type ('a,'b) t1 = [
| `t1_a of 'a
| `t1_b of 'b
]
let f ~fa ~fb = function
| `t1_a a -> fa a
| `t1_b b -> fb b
=== f1.ml ===
=== f2.ml ===
type ('a,'b,'c) t2 = [
| `t2_a of 'a
| `t2_b of 'b
| `t2_c of 'c
]
let f ~fa ~fb ~fc = function
| `t2_a a -> fa a
| `t2_b b -> fb b
| `t2_c c -> fc c
=== f2.ml ===
=== f.ml ===
type ('a,'b,'c) t3 = [
| ('a,'b) F1.t1
| ('a,'b,'c) F2.t2
]
let f ~fa ~fb ~fc = function
| # F1.t1 as x -> F1.f ~fa ~fb x
| # F2.t2 as x -> F2.f ~fa ~fb ~fc x
=== f.ml ===
except that the number of variants is not 2-3 but 800 for f1 and 3000
for f2 (the number of parameter types ('a,'b,'c) is 3).
compiling f1.ml and f1.ml takes 10-30 minutes (of 40% less if I use 3.10).
compiling f.ml takes forever. literally. it has been running for 5+
hours now and there is no sign of hope (all it has produces so far is an
empty f.cmo):
27820 sds 25 0 1343m 1.3g 1576 R 98 37.2 306:01.80 ocamlc.opt
(the 3 sample files above compile reasonably fast, but my files are larger).
the command line is
ocamlfind ocamlc -dtypes -thread -w Ae -warn-error Ae -for-pack
Tickslots -g -I . -c generic_tick.ml
is this a known problem?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGkpkePp1Qsf2qnMcRAr5mAKCnK+E472stG/892ZTHbXUOifdIGwCgkeHs
xrdhiriBPFyim9n8pHj1Cnk=
=S1Pe
-----END PGP SIGNATURE-----