From: Yaron Minsky <yminsky@janestreet.com>
To: Jonas Jensen <jj@issuu.com>
Cc: Gregory Malecha <gmalecha@gmail.com>, caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Question about Optimization
Date: Thu, 21 Apr 2016 07:45:10 -0400 [thread overview]
Message-ID: <CACLX4jSgXDZDAWsiXJHBPXkdNAGbsK4WMV367iX3UYg3MDyfEw@mail.gmail.com> (raw)
In-Reply-To: <CAExvvWxq=7ZYoU2iejz15v3EMnnyeHyCvXOAA7==FJ-+KYA47Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]
Also, Core_kernel's Sequence type fills a similar purpose. And Flambda
does a good job of optimizing the iteration in Sequence, from what I've
overheard about our experiments.
On Thu, Apr 21, 2016 at 5:32 AM, Jonas Jensen <jj@issuu.com> wrote:
> On 21 April 2016 at 09:13, Gregory Malecha <gmalecha@gmail.com> wrote:
> >
> > I'm wondering if there is any work (and interest) on supporting
> user-defined optimizations similar to GHC's rewrite rules in the Ocaml
> compiler. For example, a standard example would be specifying map fusion:
> >
> > map f (map g ls) = map (fun x -> f (g x)) ls
>
> A "boring" and practical answer is that you get this optimization by
> writing your long chain of map, filter, bind, etc. using Batteries'
> Enum (
> http://ocaml-batteries-team.github.io/batteries-included/hdoc2/BatEnum.html
> )
> or the stand-alone Gen package
> (http://cedeela.fr/~simon/software/gen/Gen.S.html). It looks
> superficially like list map, but the order of execution will be like
> after a fusion, which should improve cache locality and avoid
> allocations of intermediate lists.
>
> Cheers,
> Jonas
>
> --
> 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
>
[-- Attachment #2: Type: text/html, Size: 2357 bytes --]
next prev parent reply other threads:[~2016-04-21 11:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 7:13 Gregory Malecha
2016-04-21 9:32 ` Jonas Jensen
2016-04-21 11:45 ` Yaron Minsky [this message]
2016-04-21 15:45 ` Gregory Malecha
2016-04-21 16:02 ` Gabriel Scherer
2016-04-21 16:05 ` Daniel Bünzli
2016-04-21 16:35 ` Ben Millwood
2016-04-22 16:09 ` Gregory Malecha
2016-11-08 12:07 ` [Caml-list] The fastest stream library [Was: Question about Optimization] Oleg
2016-11-08 12:05 ` Gregory Malecha
2016-11-08 12:15 ` Gabriel Scherer
2016-11-08 12:47 ` [Caml-list] The fastest stream library [Was: Question about Oleg
2016-11-08 15:45 ` Gabriel Scherer
2016-11-12 13:01 ` Oleg
2016-11-12 16:21 ` Simon Cruanes
2016-11-12 16:35 ` Gabriel Scherer
-- strict thread matches above, loose matches on Subject: below --
2008-11-02 2:52 Question about optimization Michał C
2008-11-02 12:23 ` [Caml-list] " Peng Zang
2008-11-02 13:02 ` Jon Harrop
2008-11-02 15:52 ` Jon Harrop
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=CACLX4jSgXDZDAWsiXJHBPXkdNAGbsK4WMV367iX3UYg3MDyfEw@mail.gmail.com \
--to=yminsky@janestreet.com \
--cc=caml-list@inria.fr \
--cc=gmalecha@gmail.com \
--cc=jj@issuu.com \
/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