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 QAA07687; Wed, 7 Jul 2004 16:26:34 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA07242; Wed, 7 Jul 2004 16:26:33 +0200 (MET DST) Received: from fw.m12.ru (49_39.otts.ru [195.162.49.39] (may be forged)) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i67EQUSH024294; Wed, 7 Jul 2004 16:26:31 +0200 Received: from jah.m12.ru ([192.168.1.1]) by fw.m12.ru with esmtp (Exim 3.36 #1 (Debian)) id 1BiCvO-0002IL-00; Wed, 07 Jul 2004 20:57:26 +0700 Received: from codedj by jah.m12.ru with local (Exim 3.36 #1 (Debian)) id 1BiCvO-0000KI-00; Wed, 07 Jul 2004 20:57:26 +0700 To: "Basile Starynkevitch [local]" Cc: caml-list@inria.fr Subject: Re: [Caml-list] Does Caml have slow arithmetics ? References: <20040707091308.GA26172@bourg.inria.fr> From: Evgeny Chukreev Date: Wed, 07 Jul 2004 20:57:26 +0700 In-Reply-To: <20040707091308.GA26172@bourg.inria.fr> (Basile Starynkevitch's message of "Wed, 7 Jul 2004 11:13:08 +0200") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde with ID 40EC0816.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 arithmetics:01 2004:99 basile:01 basile:01 non-trivial:01 movl:01 movl:01 subl:01 cmpl:01 lea:99 lea:99 ocaml:01 ocaml:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 7 Jul 2004 11:13:08 +0200 Basile Starynkevitch wrote: BSl> In practice, real code do memory allocation, pattern matching, BSl> etc.. On this, Ocaml excels (and perform probably better than C or BSl> C++); more generally, Ocaml is good for real non-trivial programs. Do developers plan to add new kinds of optimization in a near future? Trivial example: let f a b = let a, b = a, b in a + b let g a b = a + b Compiled in: Test__f_57: .L100: movl %eax, %ecx .L101: movl young_ptr, %eax subl $12, %eax movl %eax, young_ptr cmpl young_limit, %eax jb .L102 leal 4(%eax), %eax movl $2048, -4(%eax) movl %ecx, (%eax) movl %ebx, 4(%eax) movl 4(%eax), %ebx movl (%eax), %eax lea -1(%eax, %ebx), %eax ret .L102: call caml_call_gc .L103: jmp .L101 Test__g_62: .L104: lea -1(%eax, %ebx), %eax ret -- ... WBR, Evgeny ... ------------------- 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