Browse thread
[Caml-list] Memory management dominates running time
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Chet Murthy <chet@w...> |
| Subject: | Re: [Caml-list] Memory management dominates running time |
By using gprof, and doing a little careful counting, you can often find out where egregious allocations are happening, and eliminate them. I can't give you good pointers on this, because, well, it's a bit of an art, and takes a lot of experience. But it _is_ doable, and I have done it to nontrivial programs in Caml, as well as in Java, attaining speedups of 2x, 3x, without much code-restructuring. E.g., once, I took a Stream-based parser, and wrote a Stream module which only supported "char Stream", and only for parsing. By writing a few auxiliary functions in addition to this, I was able to reduce the consing associated with stream-based parsing (the constant creation of "Some _" blocks) significantly, and got a rather large speedup. I was able to see that this was important, basically by looking around in the gprof profile and trying to follow where the allocation were happening. --chet-- ------------------- 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