Which of My Transient Type Checks Are Not (Almost) Free?

09/12/2019
by   Isaac Oscar Gariano, et al.
0

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 run-time 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/19/2021

A Transient Semantics for Typed Racket

Mixed-typed languages enable programmers to link typed and untyped compo...
research
02/20/2019

Optimizing and Evaluating Transient Gradual Typing

Gradual typing enables programmers to combine static and dynamic typing ...
research
11/13/2017

A Type Checking Algorithm for Higher-rank, Impredicative and Second-order Types

We study a type checking algorithm that is able to type check a nontrivi...
research
12/22/2022

A Domain-Extensible Compiler with Controllable Automation of Optimisations

In high performance domains like image processing, physics simulation or...
research
07/03/2019

NullAway: Practical Type-Based Null Safety for Java

NullPointerExceptions (NPEs) are a key source of crashes in modern Java ...
research
10/12/2022

Specializing Scope Graph Resolution Queries: Extended Edition

To warrant programmer productivity, type checker results should be corre...
research
07/01/2019

Type Checking Program Code using SHACL (Extended Version)

It is a strength of graph-based data formats, like RDF, that they are ve...

Please sign up or login with your details

Forgot password? Click here to reset