caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jan Kybic <kybic@fel.cvut.cz>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Q: Efficient operations on complex numbers
Date: 26 Jan 2004 10:00:26 +0100	[thread overview]
Message-ID: <m2hdyjozit.fsf@cmpgw-iii-23.felk.cvut.cz> (raw)
In-Reply-To: <20040124103604.A9502@pauillac.inria.fr>

Xavier Leroy:
> Yes, it does, if the .cmx files for the other compilation units are
> available.  So, I'm a bit surprised about what Jan Kybic observed.
> What I would have expected is that referring to the Complex module or
> copying it inside the source file shouldn't change the generated
> code, at least if you stay at the default inlining level.

Thank you for your reply. Yes, you are right, if I inline at
sufficiently high level (say 'ocamplopt -inline 10), then using the
Complex module is as fast as copying the code. 

As for the slowdown, it apparently depends on the compiler and/or
processor. On my system:

    Intel(R) Pentium(R) M processor 1400MHz
    Mandrake Linux release 9.1 (Bamboo) for i586
    gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
    The Objective Caml native-code compiler, version 3.07

I find that Ocaml program takes about 170~200% of the time of the C++
version, while on Christophe TROESTLER's machine (Intel(R) Pentium(R)
4 CPU 2.40GHz)), who kindly repeated my experiments, it was just
140%. So this is really a complex issue with many variables.

If I gain more insight into it, I will keep you posted.

Jan

-- 
-------------------------------------------------------------------------
Jan Kybic <kybic@ieee.org>                  tel. +420 2 2435 7264
       or <kybic@fel.cvut.cz>,     http://cmp.felk.cvut.cz/~kybic

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


      parent reply	other threads:[~2004-01-26  9:00 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
2004-01-24  9:36   ` Xavier Leroy
2004-01-24 15:40     ` Nuutti Kotivuori
2004-01-26  9:00     ` Jan Kybic [this message]

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=m2hdyjozit.fsf@cmpgw-iii-23.felk.cvut.cz \
    --to=kybic@fel.cvut.cz \
    --cc=caml-list@inria.fr \
    /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).