Thanks for the report and bisection. We're looking at this. Please
file a Mantis report in any case.
Mark
> --
On 30 October 2016 at 16:49, David Allsopp <dra-news@metastack.com> wrote:
> Berke Durak wrote:
>> I compiled and ran a simple matrix-multiplication-style benchmark
>> program written in imperative style with Bigarrays (see below)
>> using versions 4.01.0, 4.03.0, 4.03.0+flambda, 4.04.0+trunk+flambda
>> (with -version 4.04.0+dev9-2015-09-05), 4.04.0+beta2+flambda
>> (4.04.0+beta2) and 4.05+trunk+flambda (4.05.0+dev0-2016-08-01).
>>
>> Execution time increased by a factor of 2.3 from 4.03+flambda to
>> 4.04+trunk+flambda. I tried a few of the newer optimization
>> switches (-rounds X, -unboxed-types, -unbox-closures, etc.) but
>> that didn't make a significant difference.
>>
>> Execution times, repeatable within ~5%:
>>
>> 4.01.0 5.45s
>> 4.03.0 4.28s
>> 4.03.0+flambda 4.44s
>> 4.04.0+trunk+flambda 10.45s
>> 4.04.0+beta2+flambda 10.72s
>> 4.05.0+trunk+flambda 10.36s
>
> Note that this is specifically an flambda problem - neither 4.04 nor trunk exhibit the slowdown with flambda disabled.
>
> I've bisected and identified commit f7dcb as the problem (it was added to trunk after 4.03 was branched). The specific issue is the change in https://github.com/ocaml/ocaml/blob/trunk/bytecomp/ disabling conversion of refs to mutable variables when flambda is enabled. If you remove the `&& Config.flambda = false` and rebuild ocamlopt, you should find your benchmark speed restored. flambda is supposed to be performing that optimisation itself, so something is clearly (very) wrong!simplif.ml#L473
>
> Could you open a Mantis PR for this, please?
>
>
> David
>
> Caml-list mailing list. Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs