We pondered the following lesson from Joey Tuttle:

How Array Habits Can Be Harmful

.

  result =: result, grind files

  stdout result

  #  ls q* | jwork > output


We discussed the trade-offs of an array-based approach - which often requires us to bring an entire object into memory before we can do anything - versus a streaming approach which brings into memory only a modest part of an object.

Sometimes in J we find that the piece of code we wrote which ran well on a small amount of test data has difficulty working with a realistic amount of actual data. In a case like this, we'll often be forced to wrap our nice, small, elegant piece of code in an unpretty loop in order to process a large amount of data in pieces. It would be nice if there were a general, transparent way to make this transition.

NYCJUG/2009-09-08/ArrayHabitsHarmful (last edited 2009-09-10 02:02:55 by DevonMcCormick)