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 5F21A7EE35 for ; Sun, 17 Apr 2016 17:43:04 +0200 (CEST) IronPort-PHdr: 9a23:ofOdCBZ1m/U0XHlTzyfGpxv/LSx+4OfEezUN459isYplN5qZpcS+bnLW6fgltlLVR4KTs6sC0LqG9f64EjxRqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh7D0pcWYM1QArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIZoGJ/3dKUgTLFeEC9ucyVsvJWq5lH/Sl6q4XsVV2ga2jtHHgXf6hXzWp655ir1q+dnniCHIcreQrU9WDDk5KBuHkzGkiACYhsw6mLKkYRVi75HpFr1ohVlwJPPJoSSKOZ6VqzYdNIeA2FGW5ACBGR6HoqgYt5XXKI6NuFCoty4/gNWoA== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=markus.mottl@gmail.com; spf=Pass smtp.mailfrom=markus.mottl@gmail.com; spf=None smtp.helo=postmaster@mail-oi0-f51.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of markus.mottl@gmail.com) identity=pra; client-ip=209.85.218.51; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="markus.mottl@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of markus.mottl@gmail.com designates 209.85.218.51 as permitted sender) identity=mailfrom; client-ip=209.85.218.51; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="markus.mottl@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-oi0-f51.google.com) identity=helo; client-ip=209.85.218.51; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="postmaster@mail-oi0-f51.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DHAADtrRNXkjPaVdFbg1Y1bg8Gp2iSLQENgXEahXQCgRgHOBQBAQEBAQEBAREBAQEBBwsLCSEvgi2CFQEBBBIRHQEUBx0BAwwGBQsDCgICJgICIQEBEQEFARwGEwgah3EBAxKdQYExPjGLNoFqgleGYgoZJw1RhEEBAQEBAQEEAQEBAQEVAQUKBW2FJYNJgQKCQYF8gwKCVgEEh3SFX4oKMYFVikSBdY8Rh06GIBEegQ4eAQGCOR6BbyAwiQ8BAQE X-IPAS-Result: A0DHAADtrRNXkjPaVdFbg1Y1bg8Gp2iSLQENgXEahXQCgRgHOBQBAQEBAQEBAREBAQEBBwsLCSEvgi2CFQEBBBIRHQEUBx0BAwwGBQsDCgICJgICIQEBEQEFARwGEwgah3EBAxKdQYExPjGLNoFqgleGYgoZJw1RhEEBAQEBAQEEAQEBAQEVAQUKBW2FJYNJgQKCQYF8gwKCVgEEh3SFX4oKMYFVikSBdY8Rh06GIBEegQ4eAQGCOR6BbyAwiQ8BAQE X-IronPort-AV: E=Sophos;i="5.24,498,1454972400"; d="scan'208";a="174779049" Received: from mail-oi0-f51.google.com ([209.85.218.51]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 17 Apr 2016 17:43:03 +0200 Received: by mail-oi0-f51.google.com with SMTP id k142so11460823oib.1 for ; Sun, 17 Apr 2016 08:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=nzGWbRDWl/dr5nMfM7LEAvNrGzCPR3X545Vn533ICLI=; b=gtQPegLHNd1TSQuZG/gp6cPzHKYk1SCKjxvkI+DiT8ri1JLwfzPOsdXDAY5O7DVryo OCsclWngsmQqTyEzKs5+Y1bNI5CbQ0LMM3w4c+cw/KwndzmquieQAdWiyFXpCzioMj/s oelj/es2Mnv9ns6BMp0aAeUYON/tGsW8YXPBF3IXM3PVjSDcmjXIG6R24Ab69pwUnQYY CvpVhjLhjiKNj+XSc2Ob2aERzx1fZLhqc0x3CHg9+P+LKQHbmO4BFNCTJR7kgDRBhVWu 5kFAK5RJYlKJebga63+/XiIeZ1ZeYtJYdwpq/zhCabTAW7yDWXaCwChcaqIblHyHVSSf Rh/w== 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:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=nzGWbRDWl/dr5nMfM7LEAvNrGzCPR3X545Vn533ICLI=; b=fLw8JctUHtzJUpUYCxYrAN+FeOUkTXA4cPfHwcNffGhxwSumZbSznFclc7NNCdc6WL h1hVFTHPErK/i3icVrL2T3Eutcmznmxj33ILZUyBNTdJ2yO/xAboPZ11LbE23StNrI3B 5HMoINRMWLv9Z8Pt/QRNvdXjwI8FBNzcczZnv0BPapN6xZbWxOYlekv3BIFpU6oBle3r cBx513CMLsmy9TZdlHLLl8hT7Ml7c95+fZJDKj7OYsFFupLnwpGXvvx7MruT477kvwhQ xkuigAeyz8/mjsfxX0TQbG5yMTNPtIXjZYoOs7FGfMbC/Ogbi5bTKUBRZo/hrsKEYfpj KYQw== X-Gm-Message-State: AOPr4FUtl5ahbmtm9ld3ftJE9UUa1+jiKHQgKYsgR/JQWQGosZRcA+xJxzR7kAEuUIzpQNt4AQl1nEA6bFv2XQ== MIME-Version: 1.0 X-Received: by 10.157.54.188 with SMTP id h57mr1465933otc.98.1460907781852; Sun, 17 Apr 2016 08:43:01 -0700 (PDT) Received: by 10.182.61.115 with HTTP; Sun, 17 Apr 2016 08:43:01 -0700 (PDT) In-Reply-To: <5713508A.905@gmail.com> References: <56DF57FA.9070309@lexifi.com> <5713508A.905@gmail.com> Date: Sun, 17 Apr 2016 11:43:01 -0400 Message-ID: From: Markus Mottl To: Mohamed Iguernlala Cc: Jesper Louis Andersen , OCaml List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Status of Flambda in OCaml 4.03 Ultimately, comprehensive benchmarks will be necessary to determine how much of a benefit Flambda really is. But just looking at the produced assembly and some anecdotal performance evidence, it seems clear to me that Flambda is a substantial improvement. If we judge a feature by its impact on how people write code, I can already say it made a huge difference to me. For example, before Flambda was available, I had been using Camlp4 macros in a project, because it was otherwise impossible to avoid significant performance penalties, also in terms of memory consumption (closure sizes), without a lot of code duplication. Now I can completely avoid Camlp4 while at the same time writing much more elegant, pure OCaml that compiles to equivalently efficient machine code - if not better. FWIW, I usually also use "-O3 -unbox-closures", which seemed to work best in some ad-hoc tests. On Sun, Apr 17, 2016 at 4:59 AM, Mohamed Iguernlala wrote: > Good results, but it would be better to compare with 4.03.0+trunk. > > Have you used particular options for flambda (eg. -O3 -unbox-closures) ? > have you modified the default value of -inline option ? > > I noticed better performances with "-O3 -unbox-closures" on Alt-Ergo, but > I have probably to ajust the value of "-inline" (which is currently set to > 100). > > - Mohamed. > > > Le 17/04/2016 10:43, Jesper Louis Andersen a =C3=A9crit : > > Tried `opam switch ocaml-4.03.0+trunk+flambda` on the Transit format > encoder/decoder i have. I wanted to see how much faster flambda would make > the code, since I've heard 20% and 30% thrown around. It is not very > optimized code, and in particular, the encoder path is rather elegant, but > awfully slow. Well, not anymore: > > 4.02: > Name Time/Run mWd/Run mjWd/Run Prom/Run Percentage > ------------ ---------- ------------ ---------- ---------- ------------ > decode 2.12ms 352.86kw 34.86kw 34.86kw 27.88% > encode 5.07ms 647.93kw 263.69kw 250.40kw 66.70% > round_trip 7.61ms 1_000.79kw 298.54kw 285.26kw 100.00% > 4.03.0+trunk+flambda: > > =E2=94=82 Name =E2=94=82 Time/Run =E2=94=82 mWd/Run =E2=94=82 mjWd= /Run =E2=94=82 Prom/Run =E2=94=82 Percentage =E2=94=82 > > =E2=94=82 decode =E2=94=82 2.04ms =E2=94=82 319.83kw =E2=94=82 35.= 94kw =E2=94=82 35.94kw =E2=94=82 43.97% =E2=94=82 > =E2=94=82 encode =E2=94=82 2.65ms =E2=94=82 422.67kw =E2=94=82 130.= 88kw =E2=94=82 117.59kw =E2=94=82 56.95% =E2=94=82 > =E2=94=82 round_trip =E2=94=82 4.65ms =E2=94=82 742.50kw =E2=94=82 164.= 85kw =E2=94=82 151.56kw =E2=94=82 100.00% =E2=94=82 > > Pretty impressive result. Note the heavyweight lifting is due to the yajl > JSON parser and this poses a lower bound. But I think the speedup in the > encode-path is rather good. > > Note that the benchmark is probably flawed and some time passed between > these two runs, so there might be a confounder hidden in other fixes, eit= her > to yajl, or to other parts of the compiler toolchain. However, I think the > result itself stands since in practice, my encoding time was just cut in > half. > > --=20 Markus Mottl http://www.ocaml.info markus.mottl@gmail.com