An Approach to Static Performance Guarantees for Programs with Run-time Checks

04/06/2018
by   Maximiliano Klemen, et al.
0

Instrumenting programs for performing run-time checking of properties, such as regular shapes, is a common and useful technique that helps programmers detect incorrect program behaviors. This is specially true in dynamic languages such as Prolog. However, such run-time checks inevitably introduce run-time overhead (in execution time, memory, energy, etc.). Several approaches have been proposed for reducing such overhead, such as eliminating the checks that can statically be proved to always succeed, and/or optimizing the way in which the (remaining) checks are performed. However, there are cases in which it is not possible to remove all checks statically (e.g., open libraries which must check their interfaces, complex properties, unknown code, etc.) and in which, even after optimizations, these remaining checks still may introduce an unacceptable level of overhead. It is thus important for programmers to be able to determine the additional cost due to the run-time checks and compare it to some notion of admissible cost. The common practice used for estimating run-time checking overhead is profiling, which is not exhaustive by nature. Instead, we propose a method that uses static analysis to estimate such overhead, with the advantage that the estimations are functions parameterized by input data sizes. Unlike profiling, this approach can provide guarantees for all possible execution traces, and allows assessing how the overhead grows as the size of the input grows. Our method also extends an existing assertion verification framework to express "admissible" overheads, and statically and automatically checks whether the instrumented program conforms with such specifications. Finally, we present an experimental evaluation of our approach that suggests that our method is feasible and promising.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/18/2017

Exploiting Term Hiding to Reduce Run-time Checking Overhead

One of the most attractive features of untyped languages is the flexibil...
research
10/05/2022

Gradual C0: Symbolic Execution for Efficient Gradual Verification

Current static verification techniques such as separation logic support ...
research
11/22/2017

PartiSan: Fast and Flexible Sanitization via Run-time Partitioning

Code sanitizers are used to automatically detect security vulnerabilitie...
research
07/24/2020

Corpse Reviver: Sound and Efficient Gradual Typing via Contract Verification

Gradually-typed programming languages permit the incremental addition of...
research
02/10/2023

C-rusted: The Advantages of Rust, in C, without the Disadvantages

C-rusted is an innovative technology whereby C programs can be (partly) ...
research
04/07/2018

Symbolic Reasoning for Automatic Signal Placement (Extended Version)

Explicit signaling between threads is a perennial cause of bugs in concu...
research
04/10/2017

ROSA: R Optimizations with Static Analysis

R is a popular language and programming environment for data scientists....

Please sign up or login with your details

Forgot password? Click here to reset