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 AAA17145; Sat, 14 Jul 2001 00:05:43 +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 AAA17237 for ; Sat, 14 Jul 2001 00:05:42 +0200 (MET DST) Received: from shaker.exelixis.com (shaker.exelixis.com [209.0.11.254]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f6DM5eT28088 for ; Sat, 14 Jul 2001 00:05:41 +0200 (MET DST) Received: by shaker.exelixis.com; id PAA17982; Fri, 13 Jul 2001 15:05:33 -0700 (PDT) Received: from unknown(172.29.16.196) by shaker.exelixis.com via smap (V5.5) id xma017975; Fri, 13 Jul 01 15:05:22 -0700 Message-ID: <3B4F70D7.82E58A91@quasar.ipa.nw.ru> Date: Fri, 13 Jul 2001 15:06:15 -0700 From: "Alexander V. Voinov" X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: "caml-list@inria.fr" Subject: [Caml-list] Generation of streams is slow Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi All, I've run the following program and found it to be extremely slow. Why? Does it mean that streams are worth using only when they are built from input text channels, and in all other cases they are just a waste of time? Alexander open Printf let gen_stream n = let rec gs i n = if i = n then [< 'n >] else [< 'i; (gs (i+1) n) >] in gs 1 n let rec stupid_loop n s = if n > 0 then begin if n mod 1000 = 0 then (print_char('.'); flush stdout); let i = Stream.next s in if i <> n then raise (Failure "they don't match"); stupid_loop (n+1) s end else 0;; let _ = stupid_loop 1 (gen_stream 100000);; ------------------- 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