From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Nils Becker <nils.becker@bioquant.uni-heidelberg.de>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Ocaml optimizer pitfalls & work-arounds
Date: Thu, 19 Jan 2017 12:39:03 +0100 [thread overview]
Message-ID: <CAPFanBFHoSwfJU=f6Dq-M_9f3ueYou2epPh=eCs0t8HtoHSMQQ@mail.gmail.com> (raw)
In-Reply-To: <64e5fca1-a5da-9ff5-ad90-b23343d17360@bioquant.uni-heidelberg.de>
> the min, max issues can be avoided without much trouble by using
> specialized comparison, as provided in standard library extensions.
Note that min/max are already optimized from generic to specialized
when the type information is known at type-checking time. (It used to
be the case that only fully applied calls were optimized, this was
improved by Frédéric Bour to extend to non-applied primitives in 4.03
(eg. "let eq : int -> int -> _ = (=)"). That does not work when those
functions are used inside a functor body at an abstract type (which is
when we want inlining and specialization to interact better), but
there neither do Float.equal or Int.compare.
On Thu, Jan 19, 2017 at 12:20 PM, Nils Becker
<nils.becker@bioquant.uni-heidelberg.de> wrote:
> a while ago there was a proposal for deprecating the specialized
> treatment of float arrays, which was not accepted iirc. it seems that
> the slowdown of all Array.get calls is quite a high price to pay. what
> do we gain from the float array specialization? (honest question - i
> don't have a good understanding)
>
> the min, max issues can be avoided without much trouble by using
> specialized comparison, as provided in standard library extensions.
>
> n.
>
> --
> 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
next prev parent reply other threads:[~2017-01-19 11:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 6:51 Mark Hayden
2017-01-19 11:20 ` Nils Becker
2017-01-19 11:39 ` Gabriel Scherer [this message]
2017-01-19 13:26 ` Frédéric Bour
2017-01-19 14:35 ` Alain Frisch
2017-01-19 15:35 ` Ivan Gotovchits
2017-01-19 17:02 ` Hezekiah M. Carty
2017-01-19 15:41 ` Gerd Stolpmann
2017-01-19 13:41 ` Yaron Minsky
2017-01-19 17:59 ` Mark Hayden
2017-01-19 22:30 ` Yaron Minsky
2017-01-22 20:06 ` Berke Durak
2017-01-23 16:33 ` David McClain
2017-01-21 14:39 ` [Caml-list] <DKIM> " Pierre Chambart
2017-01-19 14:32 [Caml-list] " Hongbo Zhang (BLOOMBERG/ 731 LEX)
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='CAPFanBFHoSwfJU=f6Dq-M_9f3ueYou2epPh=eCs0t8HtoHSMQQ@mail.gmail.com' \
--to=gabriel.scherer@gmail.com \
--cc=caml-list@inria.fr \
--cc=nils.becker@bioquant.uni-heidelberg.de \
/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