caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Question about Optimization
@ 2016-04-21  7:13 Gregory Malecha
  2016-04-21  9:32 ` Jonas Jensen
  0 siblings, 1 reply; 19+ messages in thread
From: Gregory Malecha @ 2016-04-21  7:13 UTC (permalink / raw)
  To: caml users

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

Hello --

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

This works well in Haskell due to laziness and (mostly) purity but things
are obviously more complex in Ocaml since you can not pretend that things
are pure (due to exceptions, references, IO, and non-termination).

On a related note, this sort of optimization could require a reasonable
amount of static analysis for effects (or trying to reflect effects in the
type system). Has there been any work related to this?

Thank you.

-- 
gregory malecha
gmalecha.github.io

[-- Attachment #2: Type: text/html, Size: 1112 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Question about optimization
@ 2008-11-02  2:52 Michał C
  2008-11-02 12:23 ` [Caml-list] " Peng Zang
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Michał C @ 2008-11-02  2:52 UTC (permalink / raw)
  To: caml-list

Hi!

I'm working on a physical based ray(path) tracer and the performance  
is one of my top priorities (just after the image quality).
So I have a question about optimization: can You share some tips or  
maybe optimizing strategies to improve the speed of programs?

here is my code: http://neos1.ovh.org/ray3.ml,

and here is how I compile it:
ocamlopt -inline 100 -unsafe -ffast-math str.cmxa -I +lablgl  
lablgl.cmxa lablglut.cmxa -o ray ray.ml

Maybe You can take a look, sure I don't expect You to look through it  
in some hardcore way, but You know, maybe there are some obvious  
mistakes or unnecessary boxing which will spot your eye.

Thanks in advance,
oh and if you possibly want to see the development or how the program  
works - http://neos1.wordpress.com

Regards


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

end of thread, other threads:[~2016-11-12 16:36 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-21  7:13 [Caml-list] Question about Optimization Gregory Malecha
2016-04-21  9:32 ` Jonas Jensen
2016-04-21 11:45   ` Yaron Minsky
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

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