caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Beck01, Wolfgang" <BeckW@t-systems.com>
To: caml-list@inria.fr
Subject: tuning code
Date: Fri, 3 Mar 2006 14:17:08 +0100	[thread overview]
Message-ID: <1E4CCB2441C5C0409AD8A929482A09F31BB67E@S4DE9JSAAIG.ost.t-com.de> (raw)

There was a piece of ocaml code that had to deal with 2 million records. It
was compiled with ocamlopt 3.08.3.

Without optimisations, it took 135 s to process them, on a 3 GHz Intel Pentium 4.
After profiling and setting Gc.space_overhead to 480, it only took 88 s.

fscanf consumed many cycles but was not really necessary, so it was replaced by
something simpler. Now the program did it in 22 s.

Replacing a Hashtbl with a Map made it only slightly worse: 25 s.

After reverting to a Hashtbl and removing the -p option, it took 8.2 s.

Not bad for a functional language..


Wolfgang

--
T-Systems
Next Generation IP Services and Systems
+49 6151 937 2863
Am Kavalleriesand 3
64295 Darmstadt
Germany 


                 reply	other threads:[~2006-03-03 13:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1E4CCB2441C5C0409AD8A929482A09F31BB67E@S4DE9JSAAIG.ost.t-com.de \
    --to=beckw@t-systems.com \
    --cc=caml-list@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).