in reply to Re^2: Saving an array to a disk file
in thread Saving an array to a disk file
Hard to be sure. The join generates a large string that is output as one large write (maybe). The foreach (possibly) generates a large number of small writes. For file I/O one large write (the join) generally is much better than a large number of smaller writes (the foreach).
On the other hand, if the string gets so large it starts swapping out to disk, then the join is likely to be much worse.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Saving an array to a disk file
by chromatic (Archbishop) on May 26, 2006 at 06:21 UTC | |
|
Re^4: Saving an array to a disk file
by meraxes (Friar) on May 26, 2006 at 04:02 UTC | |
|
Re^4: Saving an array to a disk file
by blazar (Canon) on May 26, 2006 at 10:39 UTC |