Sciweavers

ICFP
2003
ACM

Optimistic evaluation: an adaptive evaluation strategy for non-strict programs

14 years 11 months ago
Optimistic evaluation: an adaptive evaluation strategy for non-strict programs
Lazy programs are beautiful, but they are slow because they build many thunks. Simple measurements show that most of these thunks are unnecessary: they are in fact always evaluated, or are always cheap. In this paper we describe Optimistic Evaluation -- an evaluation strategy that exploits this observation. Optimistic Evaluation complements compile-time analyses with run-time experiments: it evaluates a thunk speculatively, but has an abortion mechanism to back out if it makes a bad choice. A run-time adaption mechanism records expressions found to be unsuitable for speculative evaluation, and arranges for them to be evaluated more lazily in the future. We have implemented optimistic evaluation in the Glasgow Haskell Compiler. The results are encouraging: many programs speed up significantly (5-25%), some improve dramatically, and none go more than 15% slower. Categories and Subject Descriptors D.3.2 [Programming Languages]: Language Classifications--Applicative (functional) languages...
Robert Ennals, Simon L. Peyton Jones
Added 13 Dec 2009
Updated 13 Dec 2009
Type Conference
Year 2003
Where ICFP
Authors Robert Ennals, Simon L. Peyton Jones
Comments (0)