Copying operands versus copying results: A solution to the problem of large operands in FFP'S

  • Authors:
  • Gyula Magó

  • Affiliations:
  • Department of Computer Science, University of North Carolina at Chapel Hill

  • Venue:
  • FPCA '81 Proceedings of the 1981 conference on Functional programming languages and computer architecture
  • Year:
  • 1981

Quantified Score

Hi-index 0.00

Visualization

Abstract

In functional programming languages with reduction semantics, operators “use up” their operands to produce their results. This makes it difficult to execute efficiently certain computations, such as one in which several operators are applied—in succession or in parallel—to a large operand. The problem is that providing each operator with a separate copy of the large operand is a costly operation in most computer models. This paper proposes a solution to this problem in the context of a cellular computer that directly executes FFPs. The operators involved are applied in succession to the large operand, and only their results (with the exception of that of the last operator applied) need be moved. Providing each operator with a fresh copy of the large operand incurs no overhead in time. The proposed solution often allows one to avoid unproductive copying, and to suppress parallelism when it does not pay. The functional forms conditional, WHILE loop and construction are among the examples discussed. For example, when executing the conditional usually both the predicate and one of the “arms” of the conditional are applied to the operand. Since the result of the predicate computation is small, the overhead in the execution time of the conditional is negligible. A recursive matrix multiplication program described by Backus uses conditional and construction extensively. The proposed implementation technique reduces the execution time of this program on the cellular computer in question from O(n3) to O(n2).