caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Nuutti Kotivuori <naked+caml@naked.iki.fi>
To: Jan Kybic <kybic@fel.cvut.cz>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Q: Efficient operations on complex numbers
Date: Sat, 24 Jan 2004 02:31:59 +0200	[thread overview]
Message-ID: <87broukwzk.fsf@naked.iki.fi> (raw)
In-Reply-To: <m2d69b3qu7.fsf@cmpgw-iii-23.felk.cvut.cz> (Jan Kybic's message of "23 Jan 2004 11:24:32 +0100")

Jan Kybic wrote:
> 3) I could improve the OCaml time to 0.98s by including the code
> from the Complex module in my source file. (Is there a way of
> achieving the same result without actually copying it?) On the other
> hand, it did not matter whether I used tuples or records to
> represent the complex numbers, whether I defined the 'add' and 'mul'
> functions locally or at the top level, and whether I asked the
> compiler to inline or not.

I am not well versed enough to answer your other questions properly,
but this made me think there might be something fishy going around.

OCaml doesn't inline functions from other compilation units right
now. So inlining would be the natural cause of getting the speed
increase.

The OCaml compiler inlines by default - and turning off that inlining
isn't all that obvious. Calling 'ocamlopt -inline 0' will not turn it
off; but it will only inline if it doesn't increase code size. If you
truly wish to turn inlining off, you need to say 'ocamlopt -inline
-1'. And in the opposite direction it's similar. There is no simple
inlining enabled rule, but you have to specify the aggressivity to
inline yourself, for example by saying 'ocamlopt -inline 100'.

But, I have no idea if these will really make a difference, or even if
I have totally missed something here. Hopefully someone who knows a
bit more about OCaml performance with floats will chime in to tell
about it.

-- Naked

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-01-24  0:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-23 10:24 Jan Kybic
2004-01-24  0:31 ` Nuutti Kotivuori [this message]
2004-01-24  9:36   ` Xavier Leroy
2004-01-24 15:40     ` Nuutti Kotivuori
2004-01-26  9:00     ` Jan Kybic

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=87broukwzk.fsf@naked.iki.fi \
    --to=naked+caml@naked.iki.fi \
    --cc=caml-list@inria.fr \
    --cc=kybic@fel.cvut.cz \
    /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;
as well as URLs for NNTP newsgroup(s).