caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* tuning code
@ 2006-03-03 13:17 Beck01, Wolfgang
  0 siblings, 0 replies; only message in thread
From: Beck01, Wolfgang @ 2006-03-03 13:17 UTC (permalink / raw)
  To: caml-list

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 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-03 13:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-03 13:17 tuning code Beck01, Wolfgang

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).