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 TAA02534; Tue, 25 Nov 2003 19:05:56 +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 TAA01686 for ; Tue, 25 Nov 2003 19:05:55 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAPI5s127979; Tue, 25 Nov 2003 19:05:54 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA01056; Tue, 25 Nov 2003 19:05:53 +0100 (MET) Date: Tue, 25 Nov 2003 19:05:53 +0100 From: Xavier Leroy To: =?iso-8859-1?Q?Daniel_B=FCnzli?= Cc: caml-list@inria.fr Subject: Re: [Caml-list] Profiling a function execution Message-ID: <20031125190553.B1064@pauillac.inria.fr> References: <81F621FD-1629-11D8-A1E1-000393DBC266@epfl.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <81F621FD-1629-11D8-A1E1-000393DBC266@epfl.ch>; from daniel.buenzli@epfl.ch on Thu, Nov 13, 2003 at 11:34:13PM +0100 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 timings:01 0.0:01 gettimeofday:01 kernels:01 syscall:01 exploited:01 posix:01 runtime:01 hacks:01 kernel:01 compilers:01 bindings:01 bytecode:01 bytecode:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Just to complement Damien's answers: > 2) Unix.times seems to have a low resolution, which means that my > timings are often 0.0 (unless I execute the function a lot of times). I > don't want to use Unix.gettimeofday because this prevents me to make > the difference between user and system time. Has anybody bindings to > the getrusage function or another idea ? At least under Linux, getrusage() doesn't provide more accuracy than times(), since the kernel maintains user and system time as an integral number of clock ticks. I haven't looked at other Unix kernels, but I suspect that the additional precision made possible by the getrusage() syscall is simply not exploited. (Besides, times() is part of the POSIX standard while getrusage() is not, meaning less portability.) > 4) Is it possible to know at runtime whether we are running native code > or interpreted bytecode ? Some clever hacks involving external C functions were given on this list. I'm not sure I would endorse them :-) But your question begs another question: why would you need to do distinguish native code from bytecode? We're working hard on removing the last discrepancies between the two compilers... - Xavier Leroy ------------------- 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