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 OAA03327; Sun, 4 May 2003 14:38:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA03256 for ; Sun, 4 May 2003 14:38:49 +0200 (MET DST) Received: from eposta.kablonet.com.tr ([62.248.102.66]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id h44CcjH17782 for ; Sun, 4 May 2003 14:38:45 +0200 (MET DST) Received: (qmail 71108 invoked by uid 0); 4 May 2003 12:46:08 -0000 Received: from unknown (HELO 195.174.169.185) (exa@kablonet.com.tr@195.174.169.185) by 0 with SMTP; 4 May 2003 12:46:08 -0000 From: Eray Ozkural Reply-To: erayo@cs.bilkent.edu.tr Organization: Bilkent University CS Dept. To: alc@PublicPropertySoftware.com Subject: Re: [Caml-list] Efficiency of 'a list Date: Sun, 4 May 2003 15:38:11 +0300 User-Agent: KMail/1.5.9 Cc: "caml Mailing List'" References: <03ea01c311a3$ee573560$0200a8c0@gateway> <87r87fv4ya.fsf@cs.uga.edu> <3EB4922A.A69C2038@PublicPropertySoftware.com> In-Reply-To: <3EB4922A.A69C2038@PublicPropertySoftware.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200305041538.11506.exa@kablonet.com.tr> X-Spam: no; 0.00; eray:01 ozkural:01 caml-list:01 recursively:01 appends:01 dynarray:01 tlb:99 misses:01 erayo:01 bilkent:01 ankara:01 kde:01 malfunction:01 ariza:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sunday 04 May 2003 07:08, alc@PublicPropertySoftware.com wrote: > I've done a little timing of things, and according to my results: > If you care about efficiency and use OCaml, you should use lists > fairly often, ie if you are always looping and accessing the elements > in order. OCaml can iterate through a list (recursively) about twice as > fast as it can iterate through an array. It can iterate through a > list about as fast as or maybe even a little faster than C or C++ can > iterate through an array. Considering n appends and m iterations. I must point out that this is non-sense. An open table like my Dynarray module will be a lot faster than a list because of two things: 1) cache coherence (more important) 2) reduced page faults (TLB misses, important after context switches) -- Eray Ozkural (exa) Comp. Sci. Dept., Bilkent University, Ankara KDE Project: http://www.kde.org www: http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://mp3.com/ariza GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C ------------------- 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