From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 64990BC6B for ; Tue, 10 Jul 2007 00:45:58 +0200 (CEST) Received: from smtp.janestcapital.com (www.janestcapital.com [66.155.124.107]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l69Mjv2p014353 for ; Tue, 10 Jul 2007 00:45:57 +0200 Received: from [172.25.131.105] [38.96.172.125] by janestcapital.com with ESMTP (SMTPD-9.10) id AAB80418; Mon, 09 Jul 2007 18:46:16 -0400 Message-ID: <4692BAA4.1030405@gnu.org> Date: Mon, 09 Jul 2007 18:45:56 -0400 From: Sam Steingold User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: large parametrized polymorphic variant type combinations take forever to compile References: <4666E11F.6000308@podval.org> <4692991E.8040205@gnu.org> In-Reply-To: <4692991E.8040205@gnu.org> X-Enigmail-Version: 0.95.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 4692BAA5.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; parametrized:01 hash:01 gmane:01 gmane:01 variants:01 cmo:01 ocamlc:01 ocamlfind:01 ocamlc:01 -thread:01 -warn-error:01 -for-pack:01 variants:01 1.3:98 1,000:98 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sam Steingold wrote: > 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? more information: when t1 and t2 contain ~1,000 variants, both f1.ml and f2.ml compile in a few seconds, but f.ml takes forever (10+ minutes). splitting f.ml into 2 files indicates that its the function f, not type t3 that is taking all the time. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGkrqkPp1Qsf2qnMcRAsjiAJ9uEH172bR+OWZZQ3naNcfOo4fS9ACeJD79 ACmrszDW34kO4OzyISu6H8I= =N/CR -----END PGP SIGNATURE-----