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=2.2 required=5.0 tests=AWL,DNS_FROM_RFC_POST, HTML_MESSAGE,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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id DC123BB84 for ; Tue, 17 Feb 2009 10:09:26 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4BAAMNmknRVdwLkGdsb2JhbACCQTCRFT8BAQEBCQkMBxEDrDGPEQEDAQOEEAaENA X-IronPort-AV: E=Sophos;i="4.38,222,1233529200"; d="scan'208";a="24188137" Received: from mail-fx0-f11.google.com ([209.85.220.11]) by mail1-smtp-roc.national.inria.fr with ESMTP; 17 Feb 2009 10:09:26 +0100 Received: by fxm4 with SMTP id 4so12555112fxm.9 for ; Tue, 17 Feb 2009 01:09:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=iv5OC7jXOiBV6pxOpCq1MYOC55vWWpDcftBuwvp06bs=; b=k3Gr7PMkO0V1bd5SohhZke4NW07Msq5K4zSgYed7t+h11x0N5ZGtAAMEtiwhTxJKZk 5v+BT+V42tlLgty19fBYcBouvvFyG3ztfkI6yeCNTSWtzWI4hmIrhkrh9mLYnjTu973F Pjoyc3AYiwaTxXOVPcmv7vNQn224yvnhMfAMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=ZKvyOhxR8TrLKH9k/2N39wsq14YAklW0Sn13IQoQNVKOvG0/bcAYMNFKW2RKtwSh4V EhLNIthwG6X7243xFNpm/qUV0imlSt8on86lyVbUO7luloafmGiAhQRkHKkWDFdsyo1E 29E9Pkg1NQFAHYcb67HgtHxToXTIBlrWFkO7w= MIME-Version: 1.0 Sender: remidewitte@gmail.com Received: by 10.223.110.11 with SMTP id l11mr156609fap.50.1234861765538; Tue, 17 Feb 2009 01:09:25 -0800 (PST) In-Reply-To: <20090217085944.GC29651@janestcapital.com> References: <2184b2340902160715y1f935b5ehc0e6195b3f75b66b@mail.gmail.com> <891bd3390902160847p25ad3bf1pe59da620dfc667f2@mail.gmail.com> <2184b2340902160937i53b8f3fbga01eaf14ed829f8f@mail.gmail.com> <2184b2340902162340s540c5ac7g9f42b59d03f643cb@mail.gmail.com> <20090217085944.GC29651@janestcapital.com> Date: Tue, 17 Feb 2009 10:09:25 +0100 X-Google-Sender-Auth: fad43634b6f669b0 Message-ID: <2184b2340902170109g2027e998i3c73284042b4c7a2@mail.gmail.com> Subject: Re: [Caml-list] Threads performance issue. From: =?UTF-8?Q?R=C3=A9mi_Dewitte?= To: Mark Shinwell Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=001636c59832e1b43b046319a8a4 X-Spam: no; 0.00; uncomment:01 shinwell:01 0100,:01 ocamlopt:01 foo:01 ocamlopt:01 -thread:01 cmxa:01 cmxa:01 foo:01 uncomment:01 shinwell:01 0100,:01 -thread:01 2009:98 X-Attachments: cset="UTF-8" cset="UTF-8" --001636c59832e1b43b046319a8a4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You need to uncomment the line 107 with Thread calls so that it is effectively linked to threads I think and see the difference ! I will try the profiling ! R=C3=A9mi On Tue, Feb 17, 2009 at 09:59, Mark Shinwell w= rote: > On Tue, Feb 17, 2009 at 08:40:11AM +0100, R=C3=A9mi Dewitte wrote: > > I have made some further experiments. > > I have a functional version of the reading algorithm. I have the origin= al > > 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 > --001636c59832e1b43b046319a8a4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You need to uncomment the line 107 with Thread calls so that it is effectiv= ely linked to threads I think and see the difference !

I will try th= e profiling !

R=C3=A9mi

On Tue, Fe= b 17, 2009 at 09:59, Mark Shinwell <mshinwell@janestcapital.com> wro= te:
On Tue, Feb 17, 2009 at 08:40:11AM +0100, R=C3=A9mi Dewitte wrote:
> I have made some further experiments.
> I have a functional version of the reading algorithm. I have the origi= nal
> 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 wo= uld
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

--001636c59832e1b43b046319a8a4--