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=1.2 required=5.0 tests=AWL,MAILTO_TO_SPAM_ADDR, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 5A3F0BC0A for ; Thu, 18 Jan 2007 23:33:44 +0100 (CET) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.231]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0IMXgkG021846 for ; Thu, 18 Jan 2007 23:33:44 +0100 Received: by wr-out-0506.google.com with SMTP id i28so307732wra for ; Thu, 18 Jan 2007 14:33:40 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DZA0YvY49KL8vME5yDYEJA18O5qC57aum8KsLgYFXABSV7HbRFrNT+d3xObG86CIGbMn4Em//v1hKB3zQ0m+c/+zhsKZD30uqbgX/eI+t+ua6ZUDJiAJUr+9MpQ7wnS/9FaMvdIyD1UF9K5Zdz8Lo4XjHRuIcs/2pj0tfmbqB8Y= Received: by 10.78.149.13 with SMTP id w13mr1456624hud.1169159580248; Thu, 18 Jan 2007 14:33:00 -0800 (PST) Received: by 10.78.198.14 with HTTP; Thu, 18 Jan 2007 14:33:00 -0800 (PST) Message-ID: Date: Thu, 18 Jan 2007 14:33:00 -0800 From: "Nathaniel Gray" To: "Edgar Friendly" Subject: Re: [Caml-list] Benchmarking different dispatch types Cc: "Caml List" In-Reply-To: <45AED8C8.3080808@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45AED8C8.3080808@gmail.com> X-j-chkmail-Score: MSGID : 45AFF5C6.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45AFF5C6.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocamlfind:01 ocamlopt:01 -package:01 -inline:01 cmxa:01 cmxa:01 usr:01 usr:01 cheers:01 edgar:98 0.02:98 0.02:98 0.60:98 0.03:98 On 1/17/07, Edgar Friendly wrote: > > well, running only 40,000 iterations is way too low because timing > errors are going to get in the way of an accurate answer. I forgot to mention that I also tried 400,000 and 4,000,000. 400K produced similar results to 40K, while 4M produced some strange results that didn't make sense. > On my > computer, I bumped the iterations up to max_int, and still the function > call was still taking less than one CPU second of time (which I guess is > the requirement for the warning to disappear). > > Here's my numbers from an Athlon XP-M 2000+ (1.53GHz), compiled with > ocaml 3.09.3, cmd. line: > $ ocamlfind ocamlopt -package "benchmark" -inline 0 unix.cmxa > benchmark.cmxa dispatch.ml > > > Latencies for 1073741823 iterations of function, method, closure, obj. > closure: > function: 0 WALL (-0.02 usr + -0.00 sys = -0.02 CPU) > (warning: too few iterations for a reliable count) > method: 15 WALL (11.34 usr + 0.49 sys = 11.83 CPU) @ 90764313.02/s > (n=1073741823) > closure: 4 WALL ( 2.60 usr + -0.60 sys = 2.00 CPU) @ 536870911.50/s > (n=1073741823) > obj. closure: 8 WALL ( 4.31 usr + 0.03 sys = 4.34 CPU) @ > 247405950.00/s (n=1073741823) > Rate function method obj. closure > closure > function -5.36871e+10/s -- -59250% -21800% > -10100% > method 90764313/s -100% -- -63% > -83% > obj. closure 247405950/s -100% 173% -- > -54% > closure 536870911/s -101% 491% 117% > -- > > Either function calls are just that stupidly efficient, or there's some > optimization still going on. I'm guessing the second. These results are clearly garbage, since the rate of function calls is negative. Or perhaps there's some time-travel going on... Cheers, -n8 -- >>>-- Nathaniel Gray -- Caltech Computer Science ------> >>>-- Mojave Project -- http://mojave.cs.caltech.edu -->