Recycle Your Arrays!

  • Authors:
  • Roman Leshchinskiy

  • Affiliations:
  • Programming Languages and Systems, School of Computer Science and Engineering, University of New South Wales,

  • Venue:
  • PADL '09 Proceedings of the 11th International Symposium on Practical Aspects of Declarative Languages
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Purely functional arrays are notoriously difficult to implement and use efficiently due to the absence of destructive updates and the resultant frequent copying. Deforestation frameworks such as stream fusion achieve signficant improvements here but fail for a number of important operations which can nevertheless benefit from elimination of temporaries. To mitigate this problem, we extend stream fusion with support for in-place execution of array operations. This optimisation, which we call recycling , is easy to implement and can significantly reduce array allocation and copying in purely functional array algorithms.