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=0.9 required=5.0 tests=HTML_10_20,HTML_MESSAGE 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 D261CBC6B for ; Tue, 22 Aug 2006 13:07:55 +0200 (CEST) Received: from gw-eur4.philips.com (gw-eur4.philips.com [161.85.125.10]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7MB7pWt023917 for ; Tue, 22 Aug 2006 13:07:55 +0200 Received: from smtpscan-eur4.philips.com (smtpscan-eur4.mail.philips.com [130.144.57.167]) by gw-eur4.philips.com (Postfix) with ESMTP id E0F754973D for ; Tue, 22 Aug 2006 11:07:50 +0000 (UTC) Received: from smtpscan-eur4.philips.com (localhost [127.0.0.1]) by localhost.philips.com (Postfix) with ESMTP id 6DC304442 for ; Tue, 22 Aug 2006 11:07:50 +0000 (GMT) Received: from smtprelay-eur2.philips.com (smtprelay-eur2.philips.com [130.144.57.171]) by smtpscan-eur4.philips.com (Postfix) with ESMTP id A7379446B for ; Tue, 22 Aug 2006 11:07:49 +0000 (GMT) Received: from ehvrmh02.diamond.philips.com (ehvrmh02-srv.diamond.philips.com [130.139.27.125]) by smtprelay-eur2.philips.com (Postfix) with ESMTP id 43CAD5A for ; Tue, 22 Aug 2006 11:07:49 +0000 (GMT) To: Caml Mailing List Subject: Comparison between original OCAML program and its conversion to C++ MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.0.3 September 26, 2003 From: Andries Hekstra Message-ID: Date: Tue, 22 Aug 2006 13:07:12 +0200 X-MIMETrack: Serialize by Router on ehvrmh02/H/SERVER/PHILIPS(Release 6.5.5HF561 | June 9, 2006) at 22/08/2006 13:07:18, Serialize complete at 22/08/2006 13:07:18 Content-Type: multipart/alternative; boundary="=_alternative 003D2123C12571D2_=" X-Miltered: at nez-perce with ID 44EAE587.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 simulating:01 replacing:01 arrays:01 stack:01 eindhoven:01 simulating:01 replacing:01 arrays:01 stack:01 eindhoven:01 optical:98 16%:98 10.:98 This is a multipart message in MIME format. --=_alternative 003D2123C12571D2_= Content-Type: text/plain; charset="US-ASCII" 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) --=_alternative 003D2123C12571D2_= Content-Type: text/html; charset="US-ASCII"
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)
--=_alternative 003D2123C12571D2_=--