From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.9 required=5.0 tests=DNS_FROM_RFC_ABUSE, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 77ABEBC85 for ; Wed, 23 Aug 2006 01:09:30 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7MN9TSB020736 for ; Wed, 23 Aug 2006 01:09:30 +0200 Received: by ug-out-1314.google.com with SMTP id e2so2125079ugf for ; Tue, 22 Aug 2006 16:09:29 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=GJORpNATLA4CWh68v0eKqiFyDk5wdY37fKVbB4DUcAO3nY0Bm1V0rD/wR+rGY6gQVNCu7jXy6iL+nDUkZss5VtzxKMTGSo04iCQG36ibHWPoI5RIVP4WT3Bq4gWq8h8N/d6tXhkn7toDB1fiM3QN1MuhQuxXk0A5TWeRNrbFtMM= Received: by 10.66.216.20 with SMTP id o20mr4704036ugg; Tue, 22 Aug 2006 16:09:29 -0700 (PDT) Received: by 10.67.29.11 with HTTP; Tue, 22 Aug 2006 16:09:29 -0700 (PDT) Message-ID: Date: Tue, 22 Aug 2006 16:09:29 -0700 From: "Corey O'Connor" To: "Andries Hekstra" Subject: Re: [Caml-list] Comparison between original OCAML program and its conversion to C++ Cc: "Caml Mailing List" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-j-chkmail-Score: MSGID : 44EB8EA9.001 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 44EB8EA9.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 o'caml:01 ocaml:01 simulating:01 replacing:01 arrays:01 stack:01 eindhoven:01 beginner's:01 bug:01 corey:98 optical:98 16%:98 10.:98 beginners:01 Thanks for the statistics! I would, and probably others, appreciate seeing the actual source of the O'Caml and C++ programs. If it's impossible to share the entire source of both how about just some fragments? -Corey O'Connor On 8/22/06, Andries Hekstra wrote: > > Dear CAML mailing list, > > Recently, I have converted by hand, a 3500 line OCAML program simulating an > optical disk system by hand into a C++ program. This is mainly a floating > point program. As the maximum line width varied somewhat in the C++ program > and between the OCAML and the C++ program, line count is not such a good > comparison for program size. Instead I used character count after replacing > all sequences of N spaces by a single space (I did not use tabs). Then, it > turned out that the C++ program was 23% longer. Note that the variable > names, comments, were mostly the same. When I took the original files and > compared zipped file size, the C++ program was 16% larger. > With the C++ program I did not count a brief generic random > generator header file and a longer generic multi-dimensional array with > bound checking using assert statements header file as I could have taken > just standard C++ arrays on the stack. The C++ program (without optimization > and a lot of "as local as possible" variable declaration, similar to OCAML) > was around 10% faster than the OCAML program on an AMD64 platform, when > using g++ to compile the C++ program. > > Regards, > > Andries > > ------------------------------------------------------------------------ > Dr. Ir. Andries P. Hekstra > Philips Research (soon : Philips Semiconductor Research) > High Tech Campus 27 (WL-1-4.15) > 5656 AG Eindhoven > Tel./Fax/Secr. +31 40 27 42048/42566/44051 > > * "Bad software has about 100 hidden bugs ; good software only 10." (C > programming Tutor) > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: > http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > -- -Corey O'Connor