caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] flambda optimizations depends on unrelated things
@ 2017-08-27  5:23 Alexey Egorov
  2017-08-27  8:33 ` David Allsopp
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Egorov @ 2017-08-27  5:23 UTC (permalink / raw)
  To: caml users

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] flambda optimizations depends on unrelated things
  2017-08-27  5:23 [Caml-list] flambda optimizations depends on unrelated things Alexey Egorov
@ 2017-08-27  8:33 ` David Allsopp
  2017-08-27 13:25   ` Alexey Egorov
  0 siblings, 1 reply; 3+ messages in thread
From: David Allsopp @ 2017-08-27  8:33 UTC (permalink / raw)
  To: Alexey Egorov; +Cc: caml users

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] flambda optimizations depends on unrelated things
  2017-08-27  8:33 ` David Allsopp
@ 2017-08-27 13:25   ` Alexey Egorov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexey Egorov @ 2017-08-27 13:25 UTC (permalink / raw)
  To: David Allsopp; +Cc: caml users

Sure https://caml.inria.fr/mantis/view.php?id=7614

2017-08-27 13:33 GMT+05:00 David Allsopp <dra-news@metastack.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
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-27 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-27  5:23 [Caml-list] flambda optimizations depends on unrelated things Alexey Egorov
2017-08-27  8:33 ` David Allsopp
2017-08-27 13:25   ` Alexey Egorov

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).