Ticket #128 (closed task: worksforme)

Opened 4 months ago

Last modified 3 months ago

FileGenerator calculating chunk sizes incorrectly

Reported by: GuySteele Assigned to: jmaessen
Priority: trivial Milestone:
Component: library Version:
Keywords: generator generate loop chunk Cc:

Description

It appears that object FileGenerator?, in Library/FileSupport.fss, may be calculating chunk sizes incorrectly. This miscalculation will not affect correctness, only characteristics of processing speed and space.

At line 179, near the end of the method generate I believe the expression go((2 n) MAX up) should be go((2 n) MIN up). Similarly at line 212, near the end of the method generate.

It may also be that each of two occurrences of go(8 MIN up) should be go(8 MAX up).

Change History

06/11/08 12:05:46 changed by jmaessen

Hmm, I don't have this paged in, but that sounds like an entirely plausible oversight.

I'd encourage you to just fix it if you're in a position to test and commit. This is one of those things it's hard to test for.

07/03/08 08:17:24 changed by jmaessen

  • status changed from new to closed.
  • resolution set to worksforme.

I just took a close look at this and I believe the code is operating as intended. As the comment notes, we're generating file contents in parallel chunks, where we overlap the consumption of one chunk with reading the next chunk. We enlarge the chunk size as we progress until we reach the upper bound.

The initial call go(8 MIN up) sets the initial chunk size to either 8 or to the upper bound if it's less than that.

Whether this is actually a good choice of chunk size, or indeed whether the whole approach makes the slightest sense, isn't 100% clear.