Assessing the Overhead of ML Exceptions by Selective CPS Transformation

1998 
ML’s exception handling makes it possible to describe exceptional execution flows conveniently, but it also forms a performance bottleneck. Our goal is to reduce this overhead by source-level transformation. To this end, we transform source programs into continuation-passing style (CPS), replacing handle and raise expressions by continuationcatching and throwing expressions, respectively. CPS-transforming every expression, however, introduces a new cost. We therefore use an exception analysis to transform expressions selectively: if an expression is statically determined to involve exceptions then it is CPS-transformed; otherwise, it is left in direct style. In this article, we formalize this selective CPS transformation, prove its correctness, and present early experimental data indicating its effect on ML programs. ∗To appear in the proceedings of the 1998 ACM SIGPLAN Workshop on ML, September 26, 1998, Baltimore, Maryland. †http://pllab.kaist.ac.kr This work is supported in part by Korea Science and Engineering Foundation grant KOSEF 961-0100-001-2 and by Korea Ministry of Information and Communication grant 96151-IT2-12. ‡Department of Computer Science (http://cs.kaist.ac.kr), Korea Advanced Institute of Science & Technology, Taejon 305-701, Korea. E-mail: {judaigi,kwang}@cs.kaist.ac.kr §Basic Research in Computer Science (http://www.brics.dk), Centre of the Danish National Research Foundation. ¶Ny Munkegade, Building 540, DK-8000 Aarhus C, Denmark. E-mail: danvy@brics.dk
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    21
    References
    16
    Citations
    NaN
    KQI
    []