From: Keith Wansbrough <Keith.Wansbrough@cl.cam.ac.uk>
To: "Rafael 'Dido' Sevilla" <dido@imperium.ph>
Cc: John Goerzen <jgoerzen@complete.org>, caml-list@inria.fr
Subject: Re: [Caml-list] Observations on OCaml vs. Haskell
Date: Tue, 28 Sep 2004 10:31:31 +0100 [thread overview]
Message-ID: <E1CCEL8-00012D-00@mta1.cl.cam.ac.uk> (raw)
In-Reply-To: Your message of "Tue, 28 Sep 2004 04:24:49 +0800." <20040927202449.GA548@imperium.ph>
> and both languages seem to be significantly slower than OCaml in string
> handling, at least as far as this site goes:
>
> http://shootout.alioth.debian.org/
>
> For the word count benchmark OCaml scores 0.1850 seconds, while GHC is a
> dismal last place at 105.2110 seconds! Even the bytecode ocaml is an
> order of magnitude faster. The word frequency benchmark also shows this
> kind of poor string handling performance for Haskell, with OCaml scoring
> 0.5669 seconds, while GHC scores a truly dismal 6.4540, more than an
> order of magnitude slower, and even the bytecode ocaml is faster at
> 4.2644 seconds.
I severely doubt that these times are representative - the shootout
doesn't claim to be serious or meaningful. A factor of ten is
possible, but a factor of 1000 shows that something else is wrong.
But it's true that for text-handling performance in GHC you have to
use something other than list-of-Char; typically you use PackedString,
which is basically an array of bytes. The boxing and unboxing
certainly has significant cost.
Note that GHC characters are Unicode, and stored in 32 bits; OCaml
characters are only 8 bits wide, and so OCaml has a 4x advantage right
away - but loses the potential for i18n.
HTH.
--KW 8-)
-------------------
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
next prev parent reply other threads:[~2004-09-28 9:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-27 19:08 John Goerzen
2004-09-27 20:24 ` Rafael 'Dido' Sevilla
2004-09-27 21:34 ` Danny Yoo
2004-09-28 7:22 ` Ville-Pertti Keinonen
2004-09-28 18:02 ` Jon Harrop
2004-09-29 14:26 ` Brian Hurt
2004-09-29 14:20 ` Jon Harrop
2004-09-29 15:03 ` Dmitry Lomov
2004-09-28 10:10 ` [Caml-list] Caml monomorphisation (was Observations on OCaml vs. Haskell) Diego Olivier Fernandez Pons
2004-09-28 12:01 ` Richard Jones
2004-09-28 17:50 ` Jon Harrop
2004-09-28 1:56 ` [Caml-list] Observations on OCaml vs. Haskell skaller
2004-09-28 9:31 ` Keith Wansbrough [this message]
2004-09-28 9:55 ` Rafael 'Dido' Sevilla
2004-09-27 21:11 ` Christophe TROESTLER
2004-09-28 1:32 ` Jacques GARRIGUE
2004-09-28 1:46 ` skaller
2004-09-28 8:27 ` Richard Jones
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=E1CCEL8-00012D-00@mta1.cl.cam.ac.uk \
--to=keith.wansbrough@cl.cam.ac.uk \
--cc=caml-list@inria.fr \
--cc=dido@imperium.ph \
--cc=jgoerzen@complete.org \
/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