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 BBA8D8021A for ; Tue, 19 Sep 2017 18:33:55 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=helmut.brandl@gmx.net; spf=Pass smtp.mailfrom=helmut.brandl@gmx.net; spf=None smtp.helo=postmaster@mout.gmx.net Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of helmut.brandl@gmx.net) identity=pra; client-ip=212.227.15.19; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="helmut.brandl@gmx.net"; x-sender="helmut.brandl@gmx.net"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of helmut.brandl@gmx.net designates 212.227.15.19 as permitted sender) identity=mailfrom; client-ip=212.227.15.19; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="helmut.brandl@gmx.net"; x-sender="helmut.brandl@gmx.net"; 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@mout.gmx.net) identity=helo; client-ip=212.227.15.19; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="helmut.brandl@gmx.net"; x-sender="postmaster@mout.gmx.net"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A4O8x6xNA0p1lrX4cdUgl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0K/X5rarrMEGX3/hxlliBBdydsK0UzbeO+4nbGkU+or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6alEav9iYfEQnTMg98?= =?us-ascii?q?J+K9WtKDzpf/6+fn8JTWZ01VnzenevsmJxyzqUDVt9IKqYpkMKc4jBXT9ChmYe?= =?us-ascii?q?NTkENlIVeOg17W/M628JorpyRdv/c864hKS6z8c6AQQrlISjIrLzZmt4XQqRDf?= =?us-ascii?q?QF7XtTMnWWIMn08UUgU=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0ClDgAwRsFZhxMP49RbGwEBAQMBAQEJA?= =?us-ascii?q?QEBFAEBAQEBAQEBAQEBBwEBAQEBhBMDayeDdZBIiU+BdIJJlW0KJYUWAoRbQhU?= =?us-ascii?q?BAQEBAQEBAQEBARIBAQEIDQkIKC+CMwUDBB6COwEBAQECASNLEAsLGA0aAwICI?= =?us-ascii?q?SQBEQYTEooIAQMNCgIMnjmMC4InhmoBSgMKg18BAQEBBgEBAQEBAQEhgyuCAoF?= =?us-ascii?q?Qgg6CfYJYhTMvgjEFiCYMihCODjyCLYUvg1yEJ4dliGmHI4xchSSDN4E5DyaBL?= =?us-ascii?q?zIhL1MSAYJzgiOCEVgBhy2BPwEBAQ?= X-IPAS-Result: =?us-ascii?q?A0ClDgAwRsFZhxMP49RbGwEBAQMBAQEJAQEBFAEBAQEBAQE?= =?us-ascii?q?BAQEBBwEBAQEBhBMDayeDdZBIiU+BdIJJlW0KJYUWAoRbQhUBAQEBAQEBAQEBA?= =?us-ascii?q?RIBAQEIDQkIKC+CMwUDBB6COwEBAQECASNLEAsLGA0aAwICISQBEQYTEooIAQM?= =?us-ascii?q?NCgIMnjmMC4InhmoBSgMKg18BAQEBBgEBAQEBAQEhgyuCAoFQgg6CfYJYhTMvg?= =?us-ascii?q?jEFiCYMihCODjyCLYUvg1yEJ4dliGmHI4xchSSDN4E5DyaBLzIhL1MSAYJzgiO?= =?us-ascii?q?CEVgBhy2BPwEBAQ?= X-IronPort-AV: E=Sophos;i="5.42,418,1500933600"; d="scan'208,217";a="238046238" Received: from mout.gmx.net ([212.227.15.19]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 19 Sep 2017 18:33:54 +0200 Received: from [192.168.1.69] ([187.207.25.75]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LaXIV-1dXhE616ND-00mJPq; Tue, 19 Sep 2017 18:33:53 +0200 From: Helmut Brandl Message-Id: <03ED974A-ACAE-4EEB-AD46-FC4B863F228E@gmx.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_CA60B634-9FC9-4EA1-ACFC-C302097A6E14" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Date: Tue, 19 Sep 2017 11:33:48 -0500 In-Reply-To: To: caml users References: <41FF6520-51D5-4EB7-A8AF-6BB9C495D1E8@gmx.net> <690A132C-892E-45DC-A884-415E92054AC4@gmx.net> X-Mailer: Apple Mail (2.3273) X-Provags-ID: V03:K0:rAQgqT/odyroD+5z2is9Qc/k2uroezOV5c5bI5QyKmuUUPPQmH+ qLHt8Tih+C4vYagVi2vyCiNXwCa1q4aGv+aACmZ2Gb2VEUj/BRzSPlYqvSJN+IATtoGh5P5 inxIm2A5BAwEda9u5xMyjGNO+1Z6U90Ql7Xj4RP/1id4dA4UORVXRnQHiDReqLfoJvqVIev h72p0Q9qmFDasc9wx3LUQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:AKB20XI14vs=:1y9BAgjJIVs2PS1ZOKzi2m aFqW8GvcF8FUBYe0jooMG25wFydTYF3z+Ir6PNjkDjWMtxvRLqe5BGYzCX0rgHeZtZtnKRfj4 v7VpUIFGvWnsaNLVgfAbbDg2lyz9GjyiBBz4cBQ+jL2n7dGV5pcIxJhs5pJwHB8PWmJgdSOTe ahEwuT5dW9hEMq4iFEptkitQ/QBDMIarNxq4WAmkSPlDGiEjmWpeF3K6pYX/DM5og00uNqlx8 rj+F3VB6vewlmm5GW1xFSxrpWxhMbGRYcdbF6IVWiWTA+W8QV3xxdGljUDvGpvIfx0aT8L9cu zovz5AAz7k4WoP44HVQD4X2C5yEssMK0RClIP+8OPVVLzJmXp4zOz8yvclv4XPazvt/koynt8 WgGpaNIbnpxWl4354HwAHoNoAry7O1q42OrtW8M/We77ICbtS5zpxs8gvv3qMEywDDRQqJAtn DlmORFBg9j555N1Xbi2z3UuGbGn6f3sj/gpoeqoo8QVBEoLPlKYkU4hVF5B+DVY6XMpGjRaIB C7nTyXioihDupAgIKxtJa2lVz7xa5cTGzxW/m9fXX8wdTjfaxWu5Ozu/7bIVsw/ln/PLddb3G I42OMy02UIzMjEkVhhHBJDwf118lWNgXkiAj9pxt1MGy+zU019sPmkFl66kk74R65IhnHcpaQ 0XF63+e7CN4LNUjqTU9Q3cqi7yDTOVApOZ/HLbwxfTgGtxydM8oL149Td/zWyaQX+uleL2D1C qBIP8GOGLnM5ZeI0VXVSazv+pc7+lwlB8/lidbKQUvRcZXiffBlAfG3GWGyfWCBfBpbyqiE+K Tygm+g2G5yVrzaFcOOz/e7uAtPBc0KdmY3KP6cwrJ7EYpQJPMM= Subject: Re: [Caml-list] Performance penalty for using monad --Apple-Mail=_CA60B634-9FC9-4EA1-ACFC-C302097A6E14 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 One more question: It seems that flambda is necessary in order to optimize = monadic code. Is there a plan that flambda will be included in a base relea= se of ocaml?=20 Up to now all base releases like 4.03.0, 4.04.0, etc. do not include flambd= a. I have to request the extension if I want it. Helmut > On Sep 19, 2017, at 08:24, Jesper Louis Andersen wrote: >=20 > It was some time ago, but I was toying with an encoder/decoder for the "T= ransit" format (of Clojure/Cognitect fame). That decoder used monads heavil= y as well, and flambda provided roughly an order of magnitude speedup (and = a lower GC pressure as well in addition). It was enough that I made a menta= l note of using flambda if this ever went into a system with high throughpu= t requirements. >=20 > On Tue, Sep 19, 2017 at 2:47 PM Helmut Brandl > wrote: > Thanks for the hint >=20 > Helmut > > On Sep 18, 2017, at 10:31, Yotam Barnoy > wrote: > > > > You might find this > > (https://discuss.ocaml.org/t/ann-monads-the-missing-monad-transformers-= library/830/8 ) > > discussion relevant. > > > > On Mon, Sep 18, 2017 at 11:23 AM, Helmut Brandl > wrote: > >> I want to restructure my project using monads (reader, state, option, = etc.) in order to get cleaner code. > >> > >> Is there any performance penalty to pay. From my understanding there s= houldn=E2=80=99t be any or only very little since aggressive inlining shoul= d be able to compile the monads away. > >> > >> Is there any experience on how the optimizing ocaml compiler is able t= o optimize monadic code? > >> > >> Regards > >> Helmut > >> > >> -- > >> 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 > > > > -- > > 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 >=20 >=20 > -- > 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 --Apple-Mail=_CA60B634-9FC9-4EA1-ACFC-C302097A6E14 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On= e more question: It seems that flambda is necessary in order to optimize mo= nadic code. Is there a plan that flambda will be included in a base release= of ocaml? 

= Up to now all base releases like 4.03.0, 4.04.0, etc. do not include flambd= a. I have to request the extension if I want it.

Helmut

=

On Sep 19, 2017, at 08:24, Jesper Louis Andersen <jesper.louis.andersen@gmail.c= om> wrote:

It was some time ago, but I was toying wi= th an encoder/decoder for the "Transit" format (of Clojure/Cognitect fame).= That decoder used monads heavily as well, and flambda provided roughly an = order of magnitude speedup (and a lower GC pressure as well in addition). I= t was enough that I made a mental note of using flambda if this ever went i= nto a system with high throughput requirements.

On Tue, Sep = 19, 2017 at 2:47 PM Helmut Brandl <helmut.brandl@gmx.net> wrote:
Thanks for the hint

Helmut
> On Sep 18, 2017, at 10:31, Yotam Barnoy <yotambarnoy@gmail.com> w= rote:
>
> You might find this
> (= https://discuss.ocaml.org/t/ann-monads-the-missing-monad-transformers-libra= ry/830/8)
> discussion relevant.
>
> On Mon, Sep 18, 2017 at 11:23 AM, Helmut Brandl <helmut.brandl@gmx.net> wrote:
>> I want to restructure my project using monads (reader, state, opti= on, etc.) in order to get cleaner code.
>>
>> Is there any performance penalty to pay. From my understanding the= re shouldn=E2=80=99t be any or only very little since aggressive inlining s= hould be able to compile the monads away.
>>
>> Is there any experience on how the optimizing ocaml compiler is ab= le to optimize monadic code?
>>
>> Regards
>> Helmut
>>
>> --
>> Caml-list mailing list.  Subscription management and archives= :
>>
https://sympa.inria.fr/sympa/arc/caml-= list
>> Beginner's list: http://groups.yaho= o.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bug= s
>
> --
> Caml-list mailing list.  Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list=
> Beginner's list: http://groups.yahoo.co= m/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list<= br class=3D""> Beginner's list: http://groups.yahoo.com/gro= up/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

= --Apple-Mail=_CA60B634-9FC9-4EA1-ACFC-C302097A6E14--