From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 0D2007EE89 for ; Tue, 1 Nov 2016 00:16:49 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=berke.durak@gmail.com; spf=Pass smtp.mailfrom=berke.durak@gmail.com; spf=None smtp.helo=postmaster@mail-ua0-f174.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of berke.durak@gmail.com) identity=pra; client-ip=209.85.217.174; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="berke.durak@gmail.com"; x-sender="berke.durak@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of berke.durak@gmail.com designates 209.85.217.174 as permitted sender) identity=mailfrom; client-ip=209.85.217.174; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="berke.durak@gmail.com"; x-sender="berke.durak@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ua0-f174.google.com) identity=helo; client-ip=209.85.217.174; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="berke.durak@gmail.com"; x-sender="postmaster@mail-ua0-f174.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3ApgwuIRKGU0y8hE2sU9mcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgUI/jxwZ3uMQTl6Ol3ixeRBMOAuqgC27Kd6/GocFdDyK7JiGoFfp1IWk1Nou?= =?us-ascii?q?QttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIs?= =?us-ascii?q?YL+kQMiC14/vhqibwN76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKK?= =?us-ascii?q?x8zGJsIk+PzV6nvp/jtLYqySlbuuog+shcSu26Ov1gFf0LOg87KHg479HHshzK?= =?us-ascii?q?TA3HpidNEzZerh0dJgHf71nBXpb3rSb+sqIp3TKaPMvpQLQwcTar6apwVAXlhT?= =?us-ascii?q?tBPDk8pjL5kMt12YhWuhGs7zBi2YfXKNWfOeB9c+XRYMkTRkJOW89QU2pKBYbq?= =?us-ascii?q?PNhHNPYIIesN99q1nFAJtxbrQFT1CQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0A2AQDUzxdYf67ZVdFDGhwBAQQBAQoBA?= =?us-ascii?q?RcBAQQBAQoBAYJINwEBAQEBd30HpC6CLYYfi3KCBx0BCoV7AoIMB0ATAQEBAQE?= =?us-ascii?q?BAQEBAQESAQEJCwsJGzKCMwQBFQWCEAEBAQMBAQIPER0BGxILAQMBCwYDAgsDC?= =?us-ascii?q?g0WBwICIgERAQUBChIGExIICIgXAQMPCA4tiUePTYEyPzKLRoFrgl8Fg10KGSc?= =?us-ascii?q?DClSDHwEBAQEBAQEDAQEBAQEBAQEXAgYQhi2EVYR0gleCXAWGdwyIQYpUgWqER?= =?us-ascii?q?ooAgW5OhB+JKY0RgkATHoERDxECgQSCdyxDgVseNAGGUYFKAQEB?= X-IPAS-Result: =?us-ascii?q?A0A2AQDUzxdYf67ZVdFDGhwBAQQBAQoBARcBAQQBAQoBAYJ?= =?us-ascii?q?INwEBAQEBd30HpC6CLYYfi3KCBx0BCoV7AoIMB0ATAQEBAQEBAQEBAQESAQEJC?= =?us-ascii?q?wsJGzKCMwQBFQWCEAEBAQMBAQIPER0BGxILAQMBCwYDAgsDCg0WBwICIgERAQU?= =?us-ascii?q?BChIGExIICIgXAQMPCA4tiUePTYEyPzKLRoFrgl8Fg10KGScDClSDHwEBAQEBA?= =?us-ascii?q?QEDAQEBAQEBAQEXAgYQhi2EVYR0gleCXAWGdwyIQYpUgWqERooAgW5OhB+JKY0?= =?us-ascii?q?RgkATHoERDxECgQSCdyxDgVseNAGGUYFKAQEB?= X-IronPort-AV: E=Sophos;i="5.31,577,1473112800"; d="scan'208,217";a="198755904" Received: from mail-ua0-f174.google.com ([209.85.217.174]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 01 Nov 2016 00:16:47 +0100 Received: by mail-ua0-f174.google.com with SMTP id 51so98789891uai.1 for ; Mon, 31 Oct 2016 16:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fXaCMDCubuLuktSOhIKBX1DwVTCspscxG0wFNJwP4nE=; b=lCGqFvrgTxMrF56E5IjnfNirsIE//ADPfZs6ymSDtKz6nKGSlG1THOmvZjNlu2EAqp xLZuNVp2asskGdRZ/eWuQsbORZhheREBuUo8BoIu8K3fcoKZ9STNST9h6+vSEEIzrq6O 5tNN2O77gKiZlhUCI6hYaDkYg6IBFlILrRyoUptp0tN16uVxoR48lDm5M4RN3P+7m5yB eKDqmW0DLsUOeLUW3zp1KQhXakoBFCphHfH41orASzjO7kiB9ynE3GnQ235MQKpjFa07 Lf7y1SYDpi+uFV9c37X3v+NR5j9fotXQvmtNmYWHUCSqQ+CBZxxjmn/Ln2AzhBoJEgTV Fgaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fXaCMDCubuLuktSOhIKBX1DwVTCspscxG0wFNJwP4nE=; b=HRxrYGlj8k6F9fvr63rZhgK4+8mPlzV3UVqDp1uaSYbH1CqWC6ZxiHUMe6SgYN/VRI R7bwD3HfEQQ8bOsh3pgvFJ0ZnFGO3BNr1KZh0hglqn2dXA1OV0wFvDf5lK/KkivOgb7D Pf9L/07EMjYmV6l5ownsC+Lm98T6F4PKfm5MLR5qMrNmhhGedyjmtRX1tDpuZui4oVBk hu6gZ7usFf6mnfElpMgGqU5SZf4rkctnp/V7jVRtiX9RRKSi7XiYpFWy+GamMzKQha2d 9grnsqnefIEdjjjXYfO4hA3r+aKtkMHUC7fwUtrlDCoV/k8PVFLWHMogjX/LzuxU+b/a 0tzA== X-Gm-Message-State: ABUngvdTjT+k5rK79Yji5Qw8u8bxn4NyGLTbIG/z6bUw+NVsF/ktfXgbAfwuVOPt9dBtjEdJc3ZoEBCwX5lHGg== X-Received: by 10.159.32.227 with SMTP id 90mr22163816uaa.129.1477955806339; Mon, 31 Oct 2016 16:16:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.6.212 with HTTP; Mon, 31 Oct 2016 16:16:45 -0700 (PDT) In-Reply-To: References: From: Berke Durak Date: Mon, 31 Oct 2016 16:16:45 -0700 Message-ID: To: Mark Shinwell Cc: David Allsopp , caml-list Content-Type: multipart/alternative; boundary=94eb2c0b76ead4a800054031667d Subject: Re: [Caml-list] Why is some code compiled with 4.04.0 or 4.05.0 running 2.3 times slower than the same code compiled with 4.03.0? --94eb2c0b76ead4a800054031667d Content-Type: text/plain; charset=UTF-8 Thanks Mark & David. Issue opened here: https://caml.inria.fr/mantis/view.php?id=7396 On Mon, Oct 31, 2016 at 12:37 AM, Mark Shinwell wrote: > Thanks for the report and bisection. We're looking at this. Please > file a Mantis report in any case. > > Mark > > On 30 October 2016 at 16:49, David Allsopp wrote: > > Berke Durak wrote: > >> I compiled and ran a simple matrix-multiplication-style benchmark > >> program written in imperative style with Bigarrays (see below) > >> using versions 4.01.0, 4.03.0, 4.03.0+flambda, 4.04.0+trunk+flambda > >> (with -version 4.04.0+dev9-2015-09-05), 4.04.0+beta2+flambda > >> (4.04.0+beta2) and 4.05+trunk+flambda (4.05.0+dev0-2016-08-01). > >> > >> Execution time increased by a factor of 2.3 from 4.03+flambda to > >> 4.04+trunk+flambda. I tried a few of the newer optimization > >> switches (-rounds X, -unboxed-types, -unbox-closures, etc.) but > >> that didn't make a significant difference. > >> > >> Execution times, repeatable within ~5%: > >> > >> 4.01.0 5.45s > >> 4.03.0 4.28s > >> 4.03.0+flambda 4.44s > >> 4.04.0+trunk+flambda 10.45s > >> 4.04.0+beta2+flambda 10.72s > >> 4.05.0+trunk+flambda 10.36s > > > > Note that this is specifically an flambda problem - neither 4.04 nor > trunk exhibit the slowdown with flambda disabled. > > > > I've bisected and identified commit f7dcb as the problem (it was added > to trunk after 4.03 was branched). The specific issue is the change in > https://github.com/ocaml/ocaml/blob/trunk/bytecomp/simplif.ml#L473 > disabling conversion of refs to mutable variables when flambda is enabled. > If you remove the `&& Config.flambda = false` and rebuild ocamlopt, you > should find your benchmark speed restored. flambda is supposed to be > performing that optimisation itself, so something is clearly (very) wrong! > > > > Could you open a Mantis PR for this, please? > > > > > > David > > > > -- > > Caml-list mailing list. Subscription management and archives: > > https://sympa.inria.fr/sympa/arc/caml-list > > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- Berke Durak, VA7OBD (CN88) --94eb2c0b76ead4a800054031667d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks Mark & David.


On Mon, Oct 31, 2016= at 12:37 AM, Mark Shinwell <mshinwell@janestreet.com> wrote:
Thanks for the report and bisect= ion.=C2=A0 We're looking at this.=C2=A0 Please
file a Mantis report in any case.

Mark

On 30 October 2016 at 16:49, David Allsopp <dra-news@metastack.com> wrote:
> Berke Durak wrote:
>> I compiled and ran a simple matrix-multiplication-style benchmark<= br> >> program written in imperative style with Bigarrays (see below)
>> using versions 4.01.0, 4.03.0, 4.03.0+flambda, 4.04.0+trunk+flambd= a
>> (with -version 4.04.0+dev9-2015-09-05), 4.04.0+beta2+flambda
>> (4.04.0+beta2) and 4.05+trunk+flambda (4.05.0+dev0-2016-08-01).
>>
>> Execution time increased by a factor of 2.3 from 4.03+flambda to >> 4.04+trunk+flambda.=C2=A0 I tried a few of the newer optimization<= br> >> switches (-rounds X, -unboxed-types, -unbox-closures, etc.) but
>> that didn't make a significant difference.
>>
>> Execution times, repeatable within ~5%:
>>
>> 4.01.0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 5.45= s
>> 4.03.0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 4.28= s
>> 4.03.0+flambda=C2=A0 =C2=A0 =C2=A0 =C2=A0 4.44s
>> 4.04.0+trunk+flambda=C2=A0 10.45s
>> 4.04.0+beta2+flambda 10.72s
>> 4.05.0+trunk+flambda=C2=A0 10.36s
>
> Note that this is specifically an flambda problem - neither 4.04 nor t= runk exhibit the slowdown with flambda disabled.
>
> I've bisected and identified commit f7dcb as the problem (it was a= dded to trunk after 4.03 was branched). The specific issue is the change in= https://github.com/ocaml/oca= ml/blob/trunk/bytecomp/simplif.ml#L473 disabling conversion of ref= s to mutable variables when flambda is enabled. If you remove the `&&am= p; Config.flambda =3D false` and rebuild ocamlopt, you should find your ben= chmark speed restored. flambda is supposed to be performing that optimisati= on itself, so something is clearly (very) wrong!
>
> Could you open a Mantis PR for this, please?
>
>
> David
>
> --
> Caml-list mailing list.=C2=A0 Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group= /ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs



--
Berke Durak,=C2=A0VA7OBD (CN88)<= /span>
--94eb2c0b76ead4a800054031667d--