caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Corey O'Connor" <coreyoconnor@gmail.com>
To: "Andries Hekstra" <andries.hekstra@philips.com>
Cc: "Caml Mailing List" <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Comparison between original OCAML program and its conversion to C++
Date: Tue, 22 Aug 2006 16:09:29 -0700	[thread overview]
Message-ID: <c12912350608221609w3bf4c3fbmad668ef2c901b2f8@mail.gmail.com> (raw)
In-Reply-To: <OF4AB1EDDA.AA571DF4-ONC12571D2.003C1DCC-C12571D2.003D2185@philips.com>

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 <andries.hekstra@philips.com> 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


      reply	other threads:[~2006-08-22 23:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-22 11:07 Andries Hekstra
2006-08-22 23:09 ` Corey O'Connor [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=c12912350608221609w3bf4c3fbmad668ef2c901b2f8@mail.gmail.com \
    --to=coreyoconnor@gmail.com \
    --cc=andries.hekstra@philips.com \
    --cc=caml-list@yquem.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).