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=0.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 23545BC0A for ; Fri, 8 Jun 2007 14:30:28 +0200 (CEST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l58CUQ0s008854 for ; Fri, 8 Jun 2007 14:30:27 +0200 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.7/8.13.7) with ESMTP id l58CUMCX027854; Fri, 8 Jun 2007 21:30:22 +0900 (JST) Date: Fri, 08 Jun 2007 21:30:10 +0900 (JST) Message-Id: <20070608.213010.99453104.garrigue@math.nagoya-u.ac.jp> To: sds@gnu.org Cc: caml-list@inria.fr Subject: Re: [Caml-list] compiling large file hogs RAM and takes a long time. From: Jacques Garrigue In-Reply-To: <20070608.100255.84973407.garrigue@math.nagoya-u.ac.jp> References: <4666E11F.6000308@podval.org> <466829A3.2090508@gnu.org> <20070608.100255.84973407.garrigue@math.nagoya-u.ac.jp> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46694BE2.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; cvs:01 constants:01 polymorphic:01 compile:01 caml-list:01 variant:02 caml:02 compiling:02 quadratic:02 quadratic:02 garrigue:03 garrigue:03 jacques:03 jacques:03 pattern:04 > > 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. 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 :-) This doesn't change the quadratic time complexity, but as other mentioned, constants do matter. Jacques Garrigue