caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jesper Louis Andersen <jesper.louis.andersen@gmail.com>
To: Anders Fugmann <anders@fugmann.net>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Exceptions and backtraces
Date: Thu, 10 Sep 2015 13:09:58 +0200	[thread overview]
Message-ID: <CAGrdgiVQqCPpBdA7fAkqVOEwa5vFL_+Y-bK8A_rS_d3oYvppww@mail.gmail.com> (raw)
In-Reply-To: <55F16169.3070001@fugmann.net>

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

On Thu, Sep 10, 2015 at 12:54 PM, Anders Fugmann <anders@fugmann.net> 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.

[-- Attachment #2: Type: text/html, Size: 1632 bytes --]

      reply	other threads:[~2015-09-10 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 19:18 Anders Peter Fugmann
2015-09-09 19:59 ` Anders Peter Fugmann
2015-09-10  9:45   ` Jesper Louis Andersen
2015-09-10 10:54     ` Anders Fugmann
2015-09-10 11:09       ` Jesper Louis Andersen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGrdgiVQqCPpBdA7fAkqVOEwa5vFL_+Y-bK8A_rS_d3oYvppww@mail.gmail.com \
    --to=jesper.louis.andersen@gmail.com \
    --cc=anders@fugmann.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).