caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Allsopp <dra-news@metastack.com>
To: Alexey Egorov <alex.only.d@gmail.com>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] flambda optimizations depends on unrelated things
Date: Sun, 27 Aug 2017 08:33:52 +0000	[thread overview]
Message-ID: <C27AF4BD-2D96-415B-B2B8-B74D1FF6A395@metastack.com> (raw)
In-Reply-To: <CAJannG4cO5fLz=Vvs4J9PSw0jpuUn4u3nzvGURkMCvE=4A3jdQ@mail.gmail.com>

Alexey Egorov wrote:
> Hello,
> 
> I'm trying hard to make efficient pure functional streams
> implementation - and while playing with flambda, I'm discovered that
> optimizations is VERY fragile and sometimes depends on completely
> unrelated things.
> 
> Sometimes flambda goes mad if you change filename or just add some
> empty lines to your source.
> 
> Here is example, where renaming source file increases code size by a
> factor of 2 because of some unfortunate inliner decisions:
> 
> $ ls
> fragile.ml
> $ cp fragile.ml fragile2.ml
> $ md5sum *
> 6a13d560736c81b3e5b5dfe7f13c2f56 fragile2.ml
> 6a13d560736c81b3e5b5dfe7f13c2f56 fragile.ml
> $ ocamlopt -version
> 4.05.0
> $ ocamlopt -O3 fragile.ml -dflambda 2>&1 | wc -l
> 1774
> $ ocamlopt -O3 fragile2.ml -dflambda 2>&1 | wc -l
> 3835
> 
> Here is the code - https://pastebin.com/Y1DDidyN

Please could you file a report on Mantis? https://caml.inria.fr/mantis


David



  reply	other threads:[~2017-08-27  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-27  5:23 Alexey Egorov
2017-08-27  8:33 ` David Allsopp [this message]
2017-08-27 13:25   ` Alexey Egorov

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=C27AF4BD-2D96-415B-B2B8-B74D1FF6A395@metastack.com \
    --to=dra-news@metastack.com \
    --cc=alex.only.d@gmail.com \
    --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).