From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA12395; Thu, 28 Jun 2001 10:55:11 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA12389 for ; Thu, 28 Jun 2001 10:55:10 +0200 (MET DST) Received: from bassia.wanadoo.fr (smtp-rt-5.wanadoo.fr [193.252.19.159]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f5S8tAD04426 for ; Thu, 28 Jun 2001 10:55:10 +0200 (MET DST) Received: from antholoma.wanadoo.fr (193.252.19.153) by bassia.wanadoo.fr; 28 Jun 2001 10:55:09 +0200 Received: from debian (62.161.109.138) by antholoma.wanadoo.fr; 28 Jun 2001 10:54:54 +0200 Received: from moi by debian with local (Exim 3.22 #1 (Debian)) id 15FXUz-0000E2-00 for ; Thu, 28 Jun 2001 10:50:05 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] Where does Ocaml spend all the time? References: <20010628101635.A25747@hars> From: Remi VANICAT Date: 28 Jun 2001 10:50:05 +0200 In-Reply-To: <20010628101635.A25747@hars> Message-ID: <87ofr9c7k2.dlv@wanadoo.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.103 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Florian Hars writes: > I have written an ocaml program, which is about an order of magnitude > slower than a similar C program, and now I am wondering what to do. > According to gprof, I have neiter written nor called most of the > top-scoring functions in my program: > > % cumulative self self total > time seconds seconds calls ms/call ms/call name > 9.82 2.76 2.76 9822122 0.00 0.00 Verzeichnis_code_end > 9.00 5.29 2.53 3275 0.77 0.77 mark_slice > 8.15 7.58 2.29 17860 0.13 0.54 Stra$dfen_e_i_l_rec_129 > 8.04 9.84 2.26 23232718 0.00 0.00 string_equal > 7.44 11.93 2.09 4088 0.51 0.62 sweep_slice > 5.73 13.54 1.61 390646 0.00 0.01 oldify > 4.16 14.71 1.17 22241546 0.00 0.00 Eintrag_code_begin > 3.88 15.80 1.09 Stringhilfsfunktionen_code_begin > > Only the third and fourth entry seem to do anything "useful", the rest > looks like administrative overhead to me. What are these functions > doing? only the third and fourth ? the Verzeichnis_code_end seem to be part of your program (Verzeichnis? it is not English) The same for Eintrag_code_begin and Stringhilfsfunktionen_code_begin. It left mark_slice, sweep_slice and oldify, that are all part of the GC. As i don't know your code, it's difficult to bettered it, but you should concentrate over the Eintrag and Stringhilfsfunktionen functions. by the way, have you read the ocaml FAQ on efficiency? http://caml.inria.fr/FAQ/FAQ_EXPERT-eng.html#efficacite -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr