caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Strange slowness of input_line on mingw
@ 2002-10-24 14:05 Yaron M. Minsky
  2002-10-28 15:26 ` Xavier Leroy
  0 siblings, 1 reply; 8+ messages in thread
From: Yaron M. Minsky @ 2002-10-24 14:05 UTC (permalink / raw)
  To: Caml List 

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-10-29  1:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-24 14:05 [Caml-list] Strange slowness of input_line on mingw Yaron M. Minsky
2002-10-28 15:26 ` Xavier Leroy
2002-10-28 16:12   ` Yaron M. Minsky
2002-10-28 17:14     ` M E Leypold @ labnet
2002-10-28 17:28       ` Sven Luther
2002-10-28 17:42         ` Yaron M. Minsky
2002-10-29  0:10     ` Oleg
2002-10-29  1:06       ` Yaron M. Minsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).