[Haskell-cafe] Slow IO
daniel.is.fischer at web.de
Tue Sep 12 13:24:03 EDT 2006
Am Montag, 11. September 2006 18:22 schrieben Sie:
> On 9/11/06, Daniel Fischer <daniel.is.fischer at web.de> wrote:
> > The problem spec states that the input file contains about 500 test
> > cases, each given by between 1 and 100,000 lines, each line containing a
> > single word of between 2 and 1000 letters.
> > So the file should be about 12.5G on average.
> I don't think that that necessarily follows. Although I've never seen
Not necessarily of course. But as the problem contains a warning about large
input/output data, I assumed the worst reasonable case (uniform
> the input file, of course, I imagine that many cases are fairly small,
> but designed to test the accuracy of your algorithm. A few are large
> (in one way or another) to test the extremes of your algorithm. But
> the overall size of the input file is probably much, much smaller than
> that estimate. (Maybe 1MB? Maybe 10MB?)
That'd be peanuts with ByteString, 1MB even without.
> > A time limit of 7s is given.
> That's CPU time, and thus not including I/O, right? I couldn't find
Doesn't IO use the CPU? But seriously, I would have thought that's
what 'time' lists under user and that includes IO-time as far as I can tell.
> the answer on the SPOJ site. Their FAQ is a forum, but I don't see it
> In any case, the problem can't be too large; the top twenty programs
> all finished in under 0.35 (CPU seconds?). Even if yours is a tenth as
> fast as the C and C++ programs, that would be 3.5s -- twice as fast as
> it needs to be.
> Of course, you don't have access to these other programs for
> comparison; but I hope that this gives you a better idea of the size
> (and manageability) of the task.
> Good luck with it!
> --Tom Phoenix
"In My Egotistical Opinion, most people's C programs should be
indented six feet downward and covered with dirt."
-- Blair P. Houghton
More information about the Haskell-Cafe