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 D0D637F1AA for ; Thu, 10 Sep 2015 13:10:39 +0200 (CEST) IronPort-PHdr: 9a23:nw/leRWEHZ8Fr3A9S5eOBw2vXBnV8LGtZVwlr6E/grcLSJyIuqrYZh2Bt8tkgFKBZ4jH8fUM07OQ6PC8HzVeqs3e+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8GVOlsD32X1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu3SNp41Rr1ADTkgL3t9pIiy7UGCHkOz4S41VGkbiAEALRXK6Rj8WN+luy32u/Bm8CeHMsj/S7ZyXzm+ufRFUhjt3QUKLCY06inzjdFxl+pyph6svQdyxcaAYoyOLPdkOKfaYNIBA2NHUstLTCFHKoy5ZooLSeEGOLAL/MHGu1ISoE7mVkGXD+T1x2oN3yeu0A== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jesper.louis.andersen@gmail.com; spf=Pass smtp.mailfrom=jesper.louis.andersen@gmail.com; spf=None smtp.helo=postmaster@mail-wi0-f178.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jesper.louis.andersen@gmail.com) identity=pra; client-ip=209.85.212.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jesper.louis.andersen@gmail.com"; x-sender="jesper.louis.andersen@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of jesper.louis.andersen@gmail.com designates 209.85.212.178 as permitted sender) identity=mailfrom; client-ip=209.85.212.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jesper.louis.andersen@gmail.com"; x-sender="jesper.louis.andersen@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-wi0-f178.google.com) identity=helo; client-ip=209.85.212.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jesper.louis.andersen@gmail.com"; x-sender="postmaster@mail-wi0-f178.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CuAACtY/FVm7LUVdFdhGAGgyCuKItbAQ2HcAKBOwc4FAEBAQEBAQEBEAEBAQEBBgsLCSEugh2CBwEBAwESER0BGx0BAwELBgUEBzcCAiIBEQEFARwGEyKHdgEDCgipHIEwPjGLQYFsgnmJcwoZJw1WhBYBAQEBAQUBAQEBARcBBQ6GZoR6hDRYB4JpgUMFlVaMepksEiOBFx8BAYJFgX88M4cCgUcBAQE X-IPAS-Result: A0CuAACtY/FVm7LUVdFdhGAGgyCuKItbAQ2HcAKBOwc4FAEBAQEBAQEBEAEBAQEBBgsLCSEugh2CBwEBAwESER0BGx0BAwELBgUEBzcCAiIBEQEFARwGEyKHdgEDCgipHIEwPjGLQYFsgnmJcwoZJw1WhBYBAQEBAQUBAQEBARcBBQ6GZoR6hDRYB4JpgUMFlVaMepksEiOBFx8BAYJFgX88M4cCgUcBAQE X-IronPort-AV: E=Sophos;i="5.17,504,1437429600"; d="scan'208";a="145345282" Received: from mail-wi0-f178.google.com ([209.85.212.178]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Sep 2015 13:10:38 +0200 Received: by wicgb1 with SMTP id gb1so20117939wic.1 for ; Thu, 10 Sep 2015 04:10:38 -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:content-type; bh=XSgiy75aaZ5CNg0PlNywxYqj72gDUm5eCTMZI2YTBSw=; b=0LvKtEkPolAttDtMbPZ2fbKSxfLIycvFFHxphN2txbXcODaoYA2Gj9R30j9VfkehQh wHRRxmoXsaojf4WJIhfTeCArDCPdURXZX8bikwaaruSWdchhTotQAdij0kBuWmtd9Bn7 MGjQQbTWHJvaKigo7uulYPSC77rU6eu84Y7TnqQABQ6ZGsGaSfA9jaYpWvLbUMlPzKlp 3rJPd6a2MQj4tgjvKCfmbp3gKMSb/FvEBjOQMFVR4HSFTtQG3dZYgWL2AIJT3C9Lbe2T zHSPjOfor+aawprqmfpNtOVJ+KDAP8QExqTcQjCazQC7DrJOvBTCuUeiGJbT7eferEhR HY5w== X-Received: by 10.194.104.39 with SMTP id gb7mr69305233wjb.150.1441883438211; Thu, 10 Sep 2015 04:10:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.1.84 with HTTP; Thu, 10 Sep 2015 04:09:58 -0700 (PDT) In-Reply-To: <55F16169.3070001@fugmann.net> References: <55F085FE.7010809@fugmann.net> <55F08FB2.2090103@fugmann.net> <55F16169.3070001@fugmann.net> From: Jesper Louis Andersen Date: Thu, 10 Sep 2015 13:09:58 +0200 Message-ID: To: Anders Fugmann Cc: Caml List Content-Type: multipart/alternative; boundary=089e0102fae8246a12051f62a6a6 Subject: Re: [Caml-list] Exceptions and backtraces --089e0102fae8246a12051f62a6a6 Content-Type: text/plain; charset=UTF-8 On Thu, Sep 10, 2015 at 12:54 PM, Anders Fugmann wrote: > Another possibility would be to only perform TCO on recursive functions. Disabling the optimizations works in some cases, but it considerably alters the characteristics of the executed program. Programs that wouldn't reach the stack limit suddenly does, and programs that would run fast are now considerably slower. In a controlled test situation it may be worthwhile to turn off optimizations of this kind, but I've always had the feeling that this is something you have to accept for the real world deployments when requesting what a program is doing. As long as you know what is happening, reconstructing the code flow path usually isn't that hard. And OCaml isn't the only language in which this is a problem. It hits Standard ML, Erlang, and Haskell too, the latter having its own additional irregularities due to lazy evaluation. And inlining optimizations have hit me when using DTrace on C code because the optimizer decided to inline functions aggressively, which in turn removes those as targets for function boundary tracing. -- J. --089e0102fae8246a12051f62a6a6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Thu, Sep 10, 2015 at 12:54 PM, Anders Fugmann <anders@fugmann.net&= gt; wrote:
Another possibility wou= ld be to only perform TCO on recursive functions.

Disabling the optimizations works in some cas= es, but it considerably alters the characteristics of the executed program.= Programs that wouldn't reach the stack limit suddenly does, and progra= ms that would run fast are now considerably slower.

In a controlled test situation it may be worthwhile to tur= n off optimizations of this kind, but I've always had the feeling that = this is something you have to accept for the real world deployments when re= questing what a program is doing.

A= s long as you know what is happening, reconstructing the code flow path usu= ally isn't that hard. And OCaml isn't the only language in which th= is is a problem. It hits Standard ML, Erlang, and Haskell too, the latter h= aving its own additional irregularities due to lazy evaluation. And inlinin= g optimizations have hit me when using DTrace on C code because the optimiz= er decided to inline functions aggressively, which in turn removes those as= targets for function boundary tracing.


--
J.
--089e0102fae8246a12051f62a6a6--