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 MAA07876; Sat, 15 Nov 2003 12:11:19 +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 MAA07588 for ; Sat, 15 Nov 2003 12:11:17 +0100 (MET) Received: from batch16.uni-muenster.de (BATCH16.UNI-MUENSTER.DE [128.176.188.114]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAFBBH116805 for ; Sat, 15 Nov 2003 12:11:17 +0100 (MET) Received: from zivlnx01.uni-muenster.de (ZIVLNX01.UNI-MUENSTER.DE [128.176.188.24]) by batch16.uni-muenster.de (Postfix) with ESMTP id E1F271304; Sat, 15 Nov 2003 12:10:39 +0100 (MEZ) Received: from localhost (localhost.uni-muenster.de [127.0.0.1]) by zivlnx01.uni-muenster.de (Postfix with Virus Detection) with ESMTP id 60436312D7; Sat, 15 Nov 2003 12:11:15 +0100 (CET) Received: from uni-muenster.de (VPNPOOL01-0206.UNI-MUENSTER.DE [128.176.150.216]) by zivlnx01.uni-muenster.de (Postfix with Virus Detection) with ESMTP id 82100312C6; Sat, 15 Nov 2003 12:11:13 +0100 (CET) Date: Sat, 15 Nov 2003 12:11:17 +0100 Subject: Re: [Caml-list] Profiling a function execution Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: Ocaml Mailing List To: Richard Jones From: Wolfgang Lux In-Reply-To: <20031114123358.GA24353@redhat.com> Message-Id: <6F530E3A-175C-11D8-A49C-0003937628DA@uni-muenster.de> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) X-Virus-Scanned: by AMaViS 0.3.12pre7 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 wlux:01 uni-muenster:01 elapsed:01 distinguish:01 unix:02 wolfgang:02 wolfgang:02 worse:03 wrote:03 trick:03 profiled:95 cycles:04 cycles:04 wrap:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Richard Jones wrote: > If you're using a Pentium-class machine, then a nice trick is to wrap > the RDTSC assembly instruction and call that. It returns number of > clock cycles elapsed (a 64 bit number IIRC). Here's some code to get > you started: This looks like complete nonsense to me. This will neither distinguish user and system mode execution times. Even worse, clock cycles will not have any meaning if the operating system chooses to perform a task switch while the profiled function is executed. It is for such reasons that Unix systems have an getrusage call. Regards Wolfgang ------------------- 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