From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 462CB7F736 for ; Wed, 16 Sep 2015 22:00:54 +0200 (CEST) IronPort-PHdr: 9a23:j9/qwhMr1qPHpbDkKAsl6mtUPXoX/o7sNwtQ0KIMzox0Kf77rarrMEGX3/hxlliBBdydsKIYzbCH+Pm8CSQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTrkbrjsMSPM01hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4/SXEGCuC4n4BTi08iBNODwyNuBH3WpLsrm3wrON71C2yMsjmC7Y5RWLmp6xiTRutjCYcKxY49nvWg4p+lvF1uhWk8jB23Y/YKLucNvF+c6XXdNgaAFZMWsJcTWQVDoqibodJE+cFOetCh5T7pkVLqgG6CACqH6Xh0Gkb1TfNwaQm3rF5Qkn91ws6EodL6SyMoQ== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=david.teller@univ-orleans.fr; spf=Pass smtp.mailfrom=david.teller@univ-orleans.fr; spf=None smtp.helo=postmaster@sucre.univ-orleans.fr Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of david.teller@univ-orleans.fr) identity=pra; client-ip=194.167.30.94; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="david.teller@univ-orleans.fr"; x-sender="david.teller@univ-orleans.fr"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of david.teller@univ-orleans.fr designates 194.167.30.94 as permitted sender) identity=mailfrom; client-ip=194.167.30.94; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="david.teller@univ-orleans.fr"; x-sender="david.teller@univ-orleans.fr"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@sucre.univ-orleans.fr) identity=helo; client-ip=194.167.30.94; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="david.teller@univ-orleans.fr"; x-sender="postmaster@sucre.univ-orleans.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B/AQD8yflVnF4ep8Jeg3dpvziFeQKBSDwQAQEBAQEBAQEQAQEBAQEIFAlPgh2CBwEBAgIjBGILGAkTDgICDwJGBgEMCAEBiC4JtU+UOQEBAQcBAQEBGgSGc4R9hRSCaYFDBZVegkmBXWqjAwI4gjwcgVZvAYopAQEB X-IPAS-Result: A0B/AQD8yflVnF4ep8Jeg3dpvziFeQKBSDwQAQEBAQEBAQEQAQEBAQEIFAlPgh2CBwEBAgIjBGILGAkTDgICDwJGBgEMCAEBiC4JtU+UOQEBAQcBAQEBGgSGc4R9hRSCaYFDBZVegkmBXWqjAwI4gjwcgVZvAYopAQEB X-IronPort-AV: E=Sophos;i="5.17,541,1437429600"; d="asc'?scan'208";a="177935819" Received: from sucre.univ-orleans.fr ([194.167.30.94]) by mail2-smtp-roc.national.inria.fr with ESMTP; 16 Sep 2015 22:00:53 +0200 Received: from localhost (localhost [127.0.0.1]) by sucre.univ-orleans.fr (Postfix) with ESMTP id 5D0559437F; Wed, 16 Sep 2015 22:00:54 +0200 (CEST) Received: from sucre.univ-orleans.fr ([127.0.0.1]) by localhost (sucre.univ-orleans.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id he2QnlwfQoh4; Wed, 16 Sep 2015 22:00:54 +0200 (CEST) Received: from smtps.univ-orleans.fr (smtpkerb1.univ-orleans.fr [194.167.30.60]) by sucre.univ-orleans.fr (Postfix) with ESMTP id 41E8194372; Wed, 16 Sep 2015 22:00:54 +0200 (CEST) Received: from Ornithorynque.local (dau94-10-88-189-211-192.fbx.proxad.net [88.189.211.192]) by smtps.univ-orleans.fr (Postfix) with ESMTPSA id 7177D9A031; Wed, 16 Sep 2015 22:00:40 +0200 (CEST) To: Helmut Brandl , caml-list@inria.fr References: <55F9BE16.1020502@gmx.net> From: David Rajchenbach-Teller Message-ID: <55F9CA71.60102@univ-orleans.fr> Date: Wed, 16 Sep 2015 22:00:49 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55F9BE16.1020502@gmx.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hHj0oDjUfP0qhMsJLRHLIhFgC5j8MsfV7" X-Validation-by: david.teller@univ-orleans.fr Subject: Re: [Caml-list] Performance penalty of exception handling This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hHj0oDjUfP0qhMsJLRHLIhFgC5j8MsfV7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I did some benchmarking a while ago. You can find the summary here: https://hal.inria.fr/inria-00432575/PDF/monad.pdf Cheers, David On 16/09/15 21:08, Helmut Brandl wrote: > Hi all, >=20 > I use exeption handling quite frequently even in inner loops. A common > pattern: >=20 > let some_function ... =3D > ... > if cannot_compute then raise Not_found else value >=20 > try > let value =3D some_function ... in > ... > with Not_found -> > handle_exception >=20 > I use this pattern even if the direct caller of "some_function" handles > the exception. In many cases I could design "some_function" in a way > that it returns an optional value and check the optional value in the > caller. Is this significantly (at least 10%) faster? If not, I would > stay with my present design. However I am pressed for performance in the > inner loops (I am only interested in compilation to native). >=20 > Is there any information available on the preformance penalty of > exception handling? Any hints? Thanks in advance. >=20 > Regards > Helmut >=20 --hHj0oDjUfP0qhMsJLRHLIhFgC5j8MsfV7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJV+cp0AAoJED+FkPgNe9W+O2wH/jjr4NgbceVfMKnXQUB+ZbTl tor80wSUrpLLYniRPzm/FJgRqJX7Wo5rh7sEoUhPARTqb2i+KEVzPlEkYYy/MO/9 Vup5MZRw6t4wofcrihVSQXqTUbudbTJHzoLp6yc8aZ7fqCE7w1GSKtIxxKUUzH9h k5OT92PEWWD1PFzTjR3M0RIA1OrAqACqOoa6B/aWiOMr8QptZQqARD9QQ8Ytj8js Ft4zyZH63yWgXJAt8/sF7ungmHNqk2RrKJEOP9Nw/gmkP7UWaBbe36cC9I3ibbZj KNOZ33ylNWB+rjwHiUr1x/9H0ZYlQNWHaLOKTdarukAQ1lfKU/h3JD6L9SrotRA= =E1Bl -----END PGP SIGNATURE----- --hHj0oDjUfP0qhMsJLRHLIhFgC5j8MsfV7--