Repeated Recursion Unfolding for SuperLinear Speedup within Bounds
Abstract
Repeated recursion unfolding is a new approach that repeatedly unfolds a recursion with itself and simplifies it while keeping all unfolded rules. Each unfolding doubles the number of recursive steps covered. This reduces the number of recursive rule applications to its logarithm at the expense of introducing a logarithmic number of unfolded rules to the program. Efficiency crucially depends on the amount of simplification inside the unfolded rules. We prove a superlinear speedup theorem in the best case, i.e. speedup by more than a constant factor. Our optimization can lower the time complexity class of a program. In this paper, the superlinear speedup is within bounds: it holds up to an arbitrary but chosen upper bound on the number of recursive steps. We also report on the first results with a prototype implementation of repeated recursion unfolding. A simple program transformation completely removes recursion up to the chosen bound. The actual runtime improvement quickly reaches several orders of magnitude.
 Publication:

arXiv eprints
 Pub Date:
 September 2020
 arXiv:
 arXiv:2009.05314
 Bibcode:
 2020arXiv200905314F
 Keywords:

 Computer Science  Programming Languages;
 Computer Science  Computational Complexity;
 Computer Science  Performance
 EPrint:
 This is the full version of a paper presented at the 30th International Symposium on LogicBased Program Synthesis and Transformation (LOPSTR 2020)