From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 45CE0BBAF for ; Fri, 4 Dec 2009 20:09:39 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvMBABvtGEvRVdiyi2dsb2JhbACULIcXPwEBAQoLCgcRBawbMYUyI4hHAQIDBYQuBIsn X-IronPort-AV: E=Sophos;i="4.47,343,1257116400"; d="scan'208";a="39298510" Received: from mail-px0-f178.google.com ([209.85.216.178]) by mail3-smtp-sop.national.inria.fr with ESMTP; 04 Dec 2009 20:09:38 +0100 Received: by pxi8 with SMTP id 8so589935pxi.27 for ; Fri, 04 Dec 2009 11:09:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=6md2WfYoEv3I5DTkRF/x0sOGrejm2tibAj6DYnse4HQ=; b=s/9knNk7kubP0KYswtJzRbu2UkyqVkxEhlN+4D3LjKTBoII5WCb928izpiyHt6hTBv UFstgLUv5jNZNrA8eWRHtq0QLXshH9ub79BdJUzLrV1L3Gy0ptwRDz4cdm/8oGCI1Y0r /i0wzlL3SuqLAE6V7mEEH+gHaSRm0Hv6aBJ2U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=hHjUtcktIGiV55U4oXbCIG5FX+BAQr/qw7eSQqs4UtfPpo4KyP1fs7cjKGC16MGMXh zFQcikMmi0Pq0mP28iOb91kPQSztqAq+bCLVjrld+dnYF+uhmieO06rjsLyLu5bk+Om+ tvOpTImr2N7SbFtGcW71mY2Si0DVkYNCpeR4E= MIME-Version: 1.0 Sender: aaron678@gmail.com Received: by 10.143.21.29 with SMTP id y29mr422458wfi.175.1259953776677; Fri, 04 Dec 2009 11:09:36 -0800 (PST) Date: Fri, 4 Dec 2009 14:09:36 -0500 X-Google-Sender-Auth: 1ff6580579f4ec97 Message-ID: Subject: Gc.compact surprisingly helpful From: Aaron Bohannon To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; ocaml:01 inserting:01 compactions:01 upenn:01 heap:01 blocking:04 pauses:05 simulation:05 uses:07 cis:08 outermost:09 compact:09 compact:09 badly:09 real:10 Hi, I am trying to write a soft real time signal-processing application in OCaml. Running in a "simulation" mode, it spends no time blocking, and uses an outermost loop that takes about 1/10 sec to run. In order to prevent irregular GC pauses, I decided to try inserting a call to Gc.compact once per loop. I was hoping the overall throughput wouldn't suffer too badly. To my very pleasant surprise, I found the throughput *increased* by about 2%!! So in a 15 second run (with no idle time, as I said), it now does about 130 heap compactions instead of 3 and gets better total performance because of it, utterly defying my GC intuition. - Aaron