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 IAA28612; Sun, 4 May 2003 08:46:49 +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 IAA29496 for ; Sun, 4 May 2003 08:46:48 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from mailb.telia.com (mailb.telia.com [194.22.194.6]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h446klT08220 for ; Sun, 4 May 2003 08:46:48 +0200 (MET DST) Received: from d1o849.telia.com (d1o849.telia.com [213.66.248.241]) by mailb.telia.com (8.12.9/8.12.9) with ESMTP id h446klUv001067; Sun, 4 May 2003 08:46:47 +0200 (CEST) X-Original-Recipient: caml-list@inria.fr Received: from gateway (h199n1fls34o849.telia.com [213.67.121.199]) by d1o849.telia.com (8.10.2p2/8.10.1) with ESMTP id h446kkD01684; Sun, 4 May 2003 08:46:47 +0200 (CEST) From: "Mattias Waldau" To: Cc: "'caml Mailing List''" Subject: [Caml-list] Two types of efficiency (Was Efficiency of 'a list) Date: Sun, 4 May 2003 08:46:43 +0200 Message-ID: <041d01c31208$f02327e0$0200a8c0@gateway> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal In-Reply-To: <3EB4922A.A69C2038@PublicPropertySoftware.com> X-Spam: no; 0.00; mattias:01 waldau:01 scalable:01 hash:01 slower:01 stringset:01 struct:01 beginners:01 ocaml:01 typechecker:02 syntax:02 module:03 string:03 benchmarks:03 types:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > alc@PublicPropertySoftware.com > 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 We are talking about two kinds of efficiency: 1. Absolute speed for mostly small benchmarks 2. Scalable programs, i.e. they work fine for input of length 100, but goes on forever for input of length 1000. Scalability is the one that I am talking about, and is the one that mostly gets bitten by inappropriate use of lists. For me scalability is the most important. If you use Map/Hash/Set small benchmarks will be slower, however your programs are more likely to be scalable. Languages like PHP have more advanced built-in datastructures with language syntax to support them. In Ocaml, we can create the same program, however, there is no syntax support, and we have to add declarations like module StringSet = Set.Make(struct type t = string let compare = compare end) ;; It would be nice if the typechecker could deduce the type of the set and add the above declaration automatically to the program. That would make it easier for beginners to use the advanced datastructures of Ocaml. ------------------- 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