Open Access Te Herenga Waka-Victoria University of Wellington
Browse
- No file added yet -

Which of my transient type checks are not (almost) free?

Download (814.48 kB)
journal contribution
posted on 2022-11-08, 00:19 authored by Isaac Oscar GarianoIsaac Oscar Gariano, Richard Roberts, S Marr, Michael HomerMichael Homer, Robert Noble
One form of type checking used in gradually typed language is transient type checking: whenever an object ‘flows’ through code with a type annotation, the object is dynamically checked to ensure it has the methods required by the annotation. Just-in-time compilation and optimisation in virtual machines can eliminate much of the overhead of runtime transient type checks. Unfortunately this optimisation is not uniform: some type checks will significantly decrease, or even increase, a program’s performance. In this paper, we refine the so called “Takikawa” protocol, and use it to identify which type annotations have the greatest effects on performance. In particular, we show how graphing the performance of such benchmarks when varying which type annotations are present in the source code can be used to discern potential patterns in performance. We demonstrate our approach by testing the Moth virtual machine: for many of the benchmarks where Moth’s transient type checking impacts performance, we have been able to identify one or two specific type annotations that are the likely cause. Without these type annotations, the performance impact of transient type checking becomes negligible. Using our technique programmers can optimise programs by removing expensive type checks, and VM engineers can identify new opportunities for compiler optimisation.

History

Preferred citation

Gariano, I. O., Roberts, R., Marr, S., Homer, M. & Noble, J. (2019). Which of my transient type checks are not (almost) free? VMIL 2019 - Proceedings of the 11th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages, co-located with SPLASH 2019, 58-66. https://doi.org/10.1145/3358504.3361232

Journal title

VMIL 2019 - Proceedings of the 11th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages, co-located with SPLASH 2019

Publication date

2019-10-22

Pagination

58-66

Publisher

ACM Press

Publication status

Published

Usage metrics

    Journal articles

    Categories

    No categories selected

    Exports

    RefWorks
    BibTeX
    Ref. manager
    Endnote
    DataCite
    NLM
    DC