From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA03671; Fri, 21 Nov 2003 17:45:52 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA02990 for ; Fri, 21 Nov 2003 17:45:51 +0100 (MET) Received: from inria.fr (macaque.inria.fr [128.93.8.158]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hALGjo109715 for ; Fri, 21 Nov 2003 17:45:50 +0100 (MET) Date: Fri, 21 Nov 2003 17:46:31 +0100 Subject: Re: [Caml-list] Accuracy of Gc.stat () Content-Type: text/plain; charset=ISO-8859-1; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Damien Doligez To: caml-list@inria.fr Content-Transfer-Encoding: quoted-printable In-Reply-To: <1970C334-1AB9-11D8-ADB3-000393DBC266@epfl.ch> Message-Id: <425DBD4C-1C42-11D8-8941-00039310CAE8@inria.fr> X-Mailer: Apple Mail (2.552) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 damien:01 damien:01 caml-list:01 runtime:01 bug:01 bug:01 bin:01 caml-bugs:01 caml:01 bytecode:01 doligez:01 doligez:01 native:02 native:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wednesday, November 19, 2003, at 06:52 PM, Daniel B=FCnzli wrote: > Since my first attempt [1] didn't really get through, I try to=20 > reformulate my post. Sorry I didn't answer earlier, the traffic on caml-list is getting quite heavy these days. > 1) What is the accuracy of these results ? > > E.g. I read in the documentation of the Gc module that the field=20 > minor_words is only an approximation in programs compiled to native=20 > code. Because of the way we trigger a minor collection in native code, the counters will overestimate the number of words allocated by a few words per minor GC. Note that it is always an overestimation, and the error is at most 256 words per collection. > Is it also true for the other fields ? No. The other fields are accurate. > Would the figure minor+major-promoted be accurate ? No. The error in minor will propagate. > How much can I trust the figures I get ? You can repeat your experiment after changing the size of the minor heap, that will give you a good idea of the error. The bigger the heap, the smaller the error, and it converges to error=3D0 for an infinite heap. > 2) When I start profiling should I prefer a Gc.compact to a=20 > Gc.full_major ? If you're only interested in minor+major-promoted, you don't even need a Gc.full_major. A Gc.compact would be if you are timing a very allocation-intensive program, and even then I doubt it will make much difference. > 3) Is it possible to know at runtime whether we are running native=20 > code or interpreted bytecode ? Good question. I don't know the answer. Maybe you should file this as a feature wish in the bug tracking system: < http://caml.inria.fr/bin/caml-bugs >. > Regarding time profiling, a binding in the Unix module to the=20 > getrusage() function would definitvely be nice. Another candidate for the bug tracking system. -- Damien ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners