TY - GEN
T1 - Profiling for laziness
AU - Chang, Stephen
AU - Felleisen, Matthias
PY - 2014
Y1 - 2014
N2 - While many programmers appreciate the benefits of lazy programming at an abstract level, determining which parts of a concrete program to evaluate lazily poses a significant challenge for most of them. Over the past thirty years, experts have published numerous papers on the problem, but developing this level of expertise requires a significant amount of experience. We present a profiling-based technique that captures and automates this expertise for the insertion of laziness annotations into strict programs. To make this idea precise, we show how to equip a formal semantics with a metric that measures waste in an evaluation. Then we explain how to implement this metric as a dynamic profiling tool that suggests where to insert laziness into a program. Finally, we present evidence that our profiler's suggestions either match or improve on an expert's use of laziness in a range of real-world applications.
AB - While many programmers appreciate the benefits of lazy programming at an abstract level, determining which parts of a concrete program to evaluate lazily poses a significant challenge for most of them. Over the past thirty years, experts have published numerous papers on the problem, but developing this level of expertise requires a significant amount of experience. We present a profiling-based technique that captures and automates this expertise for the insertion of laziness annotations into strict programs. To make this idea precise, we show how to equip a formal semantics with a metric that measures waste in an evaluation. Then we explain how to implement this metric as a dynamic profiling tool that suggests where to insert laziness into a program. Finally, we present evidence that our profiler's suggestions either match or improve on an expert's use of laziness in a range of real-world applications.
KW - code refactoring
KW - laziness
KW - profiling
UR - https://www.scopus.com/pages/publications/84893484355
UR - https://www.scopus.com/pages/publications/84893484355#tab=citedBy
U2 - 10.1145/2535838.2535887
DO - 10.1145/2535838.2535887
M3 - Conference contribution
AN - SCOPUS:84893484355
SN - 9781450325448
T3 - Conference Record of the Annual ACM Symposium on Principles of Programming Languages
SP - 349
EP - 360
BT - POPL 2014 - Proceedings of the 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
T2 - 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2014
Y2 - 22 January 2014 through 24 January 2014
ER -