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 QAA05464; Thu, 24 Oct 2002 16:05:57 +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 QAA05349 for ; Thu, 24 Oct 2002 16:05:56 +0200 (MET DST) Received: from swan.mail.pas.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9OE5t510430 for ; Thu, 24 Oct 2002 16:05:55 +0200 (MET DST) Received: from user-0ccegbj.cable.mindspring.com ([24.199.65.115] helo=dragonfly.localdomain) by swan.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 184icR-00065B-00 for caml-list@inria.fr; Thu, 24 Oct 2002 07:05:51 -0700 Received: from 209-9-234-140.sdsl.cais.net ([209.9.234.140]) (SquirrelMail authenticated user yminsky) by dragonfly.localdomain with HTTP; Thu, 24 Oct 2002 10:05:51 -0400 (EDT) Message-ID: <32026.209.9.234.140.1035468351.squirrel@dragonfly.localdomain> Date: Thu, 24 Oct 2002 10:05:51 -0400 (EDT) Subject: [Caml-list] Strange slowness of input_line on mingw From: "Yaron M. Minsky" To: "Caml List " X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal X-Mailer: SquirrelMail (version 1.2.6) 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 I've noticed some strangely slow behavior from input_line on mingw. I wrote a simple loop to scan through a file, and found that for a given file, it took about 10 seconds to run, whereas wc -l took only a small fraction of a second -- the difference was about a factor of 70. This is on a W2K machine using mingw. On the other hand, using the same file on a linux box, the difference between wc -l and my code was only about a factor of 3. Any ideas where the big difference might be coming from? The code I wrote is attached below. y open Printf let fname = try Sys.argv.(1) with _ -> printf "Must provide filename\n"; exit (-1)let file = open_in fname (* let read = Newparse.create_tick_reader file*) let () = try while true do ignore (input_line file); done with End_of_file -> printf "File ended. Hah!\n" -- |--------/ Yaron M. Minsky \--------| |--------\ http://www.cs.cornell.edu/home/yminsky/ /--------| Open PGP --- KeyID B1FFD916 (new key as of Dec 4th) Fingerprint: 5BF6 83E1 0CE3 1043 95D8 F8D5 9F12 B3A9 B1FF D916 ------------------- 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