From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA11195; Mon, 26 Jan 2004 10:00:42 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA10581 for ; Mon, 26 Jan 2004 10:00:40 +0100 (MET) Received: from relay.felk.cvut.cz (relay.felk.cvut.cz [147.32.80.7]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id i0Q90ev10235 for ; Mon, 26 Jan 2004 10:00:40 +0100 (MET) Received: from k333.felk.cvut.cz (k333.felk.cvut.cz [147.32.87.5]) by relay.felk.cvut.cz (8.12.10/8.12.10) with ESMTP id i0Q90ZQo077466 for ; Mon, 26 Jan 2004 10:00:35 +0100 (CET) (envelope-from kybic@fel.cvut.cz) Received: from K333/SpoolDir by k333.felk.cvut.cz (Mercury 1.48); 26 Jan 04 10:00:35 +0100 Received: from SpoolDir by K333 (Mercury 1.48); 26 Jan 04 10:00:34 +0100 Received: from cmpgw-iii-23.felk.cvut.cz (147.32.84.2) by k333.felk.cvut.cz (Mercury 1.48) with ESMTP; 26 Jan 04 10:00:26 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] Q: Efficient operations on complex numbers References: <87broukwzk.fsf@naked.iki.fi> <20040124103604.A9502@pauillac.inria.fr> From: Jan Kybic In-Reply-To: <20040124103604.A9502@pauillac.inria.fr> Date: 26 Jan 2004 10:00:26 +0100 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.93 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-felk: Found to be clean X-MailScanner-SpamCheck-felk: not spam, SpamAssassin (score=-4.9, required 5, BAYES_00) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 cmx:01 inlining:01 -inline:01 1400:99 mandrake:01 gcc:01 mandrake:01 3.07:01 200%:99 420:99 compiler:01 compiler:01 christophe:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 tel. +420 2 2435 7264 or , 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