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,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 34CB4BB84 for ; Tue, 17 Feb 2009 09:59:53 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar4BANwLmkkmachml2dsb2JhbACURQEBAQEBCBUHu1OEEwY X-IronPort-AV: E=Sophos;i="4.38,222,1233529200"; d="scan'208";a="24187323" Received: from mx2.janestcapital.com ([38.105.200.102]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Feb 2009 09:59:49 +0100 Received: from nyc-qsv-mail1.delacy.com ([172.25.22.57]) by mx2.janestcapital.com with esmtp (Exim 4.69) (envelope-from ) id 1LZLnu-0002pO-Qc; Tue, 17 Feb 2009 03:59:46 -0500 Received: from nyc-qsv-004.delacy.com ([172.25.22.194] helo=qsmtp.delacy.com) by nyc-qsv-mail1.DELACY.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1LZLnu-0006Da-PF; Tue, 17 Feb 2009 03:59:46 -0500 Received: from lon-qws-008.delacy.com ([172.30.3.108] helo=lon-qws-008) by qsmtp.delacy.com with smtp (Exim 4.63) (envelope-from ) id 1LZLnt-0004Zo-LK; Tue, 17 Feb 2009 03:59:46 -0500 Received: by lon-qws-008 (sSMTP sendmail emulation); Tue, 17 Feb 2009 08:59:44 +0000 From: "Mark Shinwell" Date: Tue, 17 Feb 2009 08:59:44 +0000 To: =?iso-8859-1?Q?R=E9mi?= Dewitte Cc: caml-list@inria.fr Subject: Re: [Caml-list] Threads performance issue. Message-ID: <20090217085944.GC29651@janestcapital.com> References: <2184b2340902160715y1f935b5ehc0e6195b3f75b66b@mail.gmail.com> <891bd3390902160847p25ad3bf1pe59da620dfc667f2@mail.gmail.com> <2184b2340902160937i53b8f3fbga01eaf14ed829f8f@mail.gmail.com> <2184b2340902162340s540c5ac7g9f42b59d03f643cb@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2184b2340902162340s540c5ac7g9f42b59d03f643cb@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam: no; 0.00; shinwell:01 0100,:01 ocamlopt:01 foo:01 ocamlopt:01 -thread:01 cmxa:01 cmxa:01 foo:01 2009:98 transf:98 transf:98 threads:01 threads:01 wrote:01 On Tue, Feb 17, 2009 at 08:40:11AM +0100, Rémi Dewitte wrote: > I have made some further experiments. > I have a functional version of the reading algorithm. I have the original > imperative version of the algorithm. > Either it is linked to thread (T) or not (X). Either it uses extlib (E) or > not (X). Using: ocamlopt -o foo transf.ml ocamlopt -thread -o foothread transf.ml unix.cmxa threads.cmxa on local disk with a 24Mb, approx. 500,000-line CSV file, I only see a minor slowdown with foothread as opposed to foo. (A minor slowdown would inded be expected.) So I'm confused as to why your results are so different. You could use ocamlopt -p and run gprof on the resulting gmon.out file. Mark