@@ -469,6 +469,11 @@ flattenArraysRev (D.Stream step state) = D.Stream step' (OuterLoop state)
469469-- due to GC overhead because we need to buffer the arrays before we flatten
470470-- all the arrays.
471471--
472+-- We could take the approach of doubling the memory allocation on each
473+-- overflow. This would result in more or less the same amount of copying as in
474+-- the chunking approach. However, if we have to shrink in the end then it may
475+-- result in an extra copy of the entire data.
476+--
472477{-# INLINE fromStreamD #-}
473478fromStreamD :: (MonadIO m, Storable a) => D.Stream m a -> m (Array a)
474479fromStreamD m = do