From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 10E0E7EE89 for ; Mon, 31 Oct 2016 08:37:29 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=mshinwell@janestreet.com; spf=Pass smtp.mailfrom=mshinwell@janestreet.com; spf=None smtp.helo=postmaster@mxout3.mail.janestreet.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of mshinwell@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="mshinwell@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of mshinwell@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="mshinwell@janestreet.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@mxout3.mail.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="postmaster@mxout3.mail.janestreet.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AuNazXxLcqSpnan0gBdmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgUI/XxwZ3uMQTl6Ol3ixeRBMOAuqgC1Lqd6vixEUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkIt?= =?us-ascii?q?f6KuS9SU0JT8jrjjs7ToICxwzAKnZr1zKBjk5S7wjeIxxbVYF6Aq1xHSqWFJce?= =?us-ascii?q?kFjUlhJFaUggqurpzopM0r221qtvkg789NV7nhN+R9FOQATWcQCH0u/MDgqTXE?= =?us-ascii?q?SAKO4DNcDjRXwVJ0BF3p5Q/7Ut/Yti/hsfJlkH2WJ8SzS70rQhyn4rtiUwPhgy?= =?us-ascii?q?RBPDk8pjL5kMt12YdSuhHpnBx+xZHZZIXdYP9lfqLbYt4eQUJDV8BcTDBbD46g?= =?us-ascii?q?KYAICrxSbq5js4Dhqg5W/lOFDg62Cbaql2ZF?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BuAADM8xZYfeXIaSZcHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBgn8BAQEBAXd9B6Qsgi2SEYIHHQuFewKCAwdAEwEBAQEBAQEBAQE?= =?us-ascii?q?BEgEBCRYJTYIzBAEVBYIRAQEEAQIPER0BASwLAQ8LCwMKAgIJFgcCAiISAQUBC?= =?us-ascii?q?hIGEwgKCAiIGAMXAwulBYEyPzKKX2eESQEBBYQYA4NzAQEBAQEBAQEBAQEBAQE?= =?us-ascii?q?BAQEBAQEVCBB3hTaEVYRHgwSCXIZ8DJMVhjCKAIFuToQfiSmNEYJAEx6BESABh?= =?us-ascii?q?CdDgTtyhgKBSgEBAQ?= X-IPAS-Result: =?us-ascii?q?A0BuAADM8xZYfeXIaSZcHAEBBAEBCgEBFwEBBAEBCgEBgn8?= =?us-ascii?q?BAQEBAXd9B6Qsgi2SEYIHHQuFewKCAwdAEwEBAQEBAQEBAQEBEgEBCRYJTYIzB?= =?us-ascii?q?AEVBYIRAQEEAQIPER0BASwLAQ8LCwMKAgIJFgcCAiISAQUBChIGEwgKCAiIGAM?= =?us-ascii?q?XAwulBYEyPzKKX2eESQEBBYQYA4NzAQEBAQEBAQEBAQEBAQEBAQEBAQEVCBB3h?= =?us-ascii?q?TaEVYRHgwSCXIZ8DJMVhjCKAIFuToQfiSmNEYJAEx6BESABhCdDgTtyhgKBSgE?= =?us-ascii?q?BAQ?= X-IronPort-AV: E=Sophos;i="5.31,426,1473112800"; d="scan'208";a="198689506" Received: from mxout3.mail.janestreet.com ([38.105.200.229]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2016 08:37:27 +0100 Received: from tot-qpr-mailcore2.delacy.com ([172.27.56.106] helo=tot-qpr-mailcore2) by mxout3.mail.janestreet.com with esmtps (UNKNOWN:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1c179q-00063z-Ni for caml-list@inria.fr; Mon, 31 Oct 2016 03:37:26 -0400 X-JS-Flow: external X-JS-Scanner-attachment: (ok) No attachments Received: by tot-qpr-mailcore2 with JS-mailcore (0.1) (envelope-from ) id BYFvS2-AAACYg-Vw; 2016-10-31 03:37:26.697829-04:00 Received: from mail-vk0-f70.google.com ([209.85.213.70]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1c179q-0003hz-KM for caml-list@inria.fr; Mon, 31 Oct 2016 03:37:26 -0400 Received: by mail-vk0-f70.google.com with SMTP id x186so2943240vkd.1 for ; Mon, 31 Oct 2016 00:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=5suHtrBfJ4Qrdv0td9pW3V+cVjD0urP9M/5fOFt9Fgo=; b=QoUk1yo3tEF4ECpxkJhOquyDqBPV0HSXu0IRVaUg/9o5/wBi6RPk5MaDE+4/C3EUIK uRFMNcHko9f5hZPiW90C7VR6tXlM+fZcJrpp6WEulvme/qgqOf41Hkq5I7hMG6hnI9cf QNvPlk/pfnaVqaa+B2viUWrpruIEeypETUvks= 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:content-transfer-encoding; bh=5suHtrBfJ4Qrdv0td9pW3V+cVjD0urP9M/5fOFt9Fgo=; b=guTS4J/hOAbloTduyaJRkGfj/jWioexNvgrV/qEngXqRdzmw4bdFO5tapPLBH2f2B7 BcKQ5cghUeDCHSHW215p8hd4jmU233mu6L4kE6yfLi4KLUsaXRpK+vZjtEvdabEAU4sV XrT+tCZUZ4cA11JQs71ZPZxQJILosfJtuVdOcuGa30Se4RyR2Xfh12YVfCPWYe2AqPFt S9L/HdfjXryMcwB9RZNjVvcHC6ZvqHUyFLuK4IKQDJTVSVp51rtEKqUBkIwBNxSCaOZS QHNdXZRR84bcRif0+Gp+oH6qQoF0aqbi4SOa1xM4Ymuw5kEUe6tar/IiJej8paZ+dQBP eVZw== X-Gm-Message-State: ABUngvf22/AUojtYzFeSoQHmk8bo6kda14NXOPbJ0jUMI1Ew/Gbmwxa3vvtiaMkrQDIyqsJ1GP8TJoFwU4np2FK3KsWpAXKzXfH9tq1hn3v9gzpBlIofb0FfsyA97lt20PsCBspyq8ZacSRjz+Gq X-Received: by 10.176.82.48 with SMTP id i45mr18750542uaa.126.1477899446252; Mon, 31 Oct 2016 00:37:26 -0700 (PDT) X-Received: by 10.176.82.48 with SMTP id i45mr18750536uaa.126.1477899446032; Mon, 31 Oct 2016 00:37:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.118.197 with HTTP; Mon, 31 Oct 2016 00:37:25 -0700 (PDT) In-Reply-To: References: From:Mark Shinwell Date: Mon, 31 Oct 2016 07:37:25 +0000 Message-ID: To:David Allsopp Cc:Berke Durak , caml-list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-JS-Processed-by: mailcore X-Validation-by: mshinwell@janestreet.com 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? 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 trun= k 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 conv= ersion of refs to mutable variables when flambda is enabled. If you remove = the `&& Config.flambda =3D false` and rebuild ocamlopt, you should find you= r benchmark speed restored. flambda is supposed to be performing that optim= isation 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