High Performance Erlang -- Introduction

Motivation

Software for control systems have applications in cars, trains, telecom networks, factories, powerplants. Demands on such software are increasing: greater functionality, higher reliability, less maintenance, shorter development times. To address these demands, Ericsson has developed the concurrent functional language Erlang. The goal is shorter time-to-market (increased revenue) and lower maintenance costs (reduced expenses).

Performance of both sequential and concurrent code is an important issue in control system software. High-level languages, such as Erlang, do not yet reach the performance levels of established languages such as C. The are several reasons for this. First, the data and control abstractions of C is closer to the hardware than those of high-level languages. Second, many years of academic research and industrial R&D have been directed towards optimizing C. The resulting techniques are only to some degree applicable to high-level languages. New research is needed that address the new compilation and optimization problems raised by new languages.

A computer system consists of both hardware (e.g. processor and memory system) and software (e.g. compiler and operating system). Computer system design should be guided by the static and dynamic characteristic of real applications, not artificial benchmarks. This was one of the fundamental insights of the hardware community in the early 1980s. Today, operating system and compiler researchers are also adopting this methodology.

Here a lies a fundamental problem in finding new, efficient compilation technniques for new programming languages: we know virtually nothing about the static and dynamic characteristics of large applications written in such languages. The existence of large Erlang applications at Ericsson provides a unique opportunity for academic compiler researchers to adapt a sound methodology, based on measurements of real applications, when trying to meet the compilation challenges raised by high-level languages such as Erlang.

An important practical problem facing the compiler researcher is this: you cannot make measurements on real application unless you have a stable and complete language implementation; moreover, this should be your own implementation, since otherwise you cannot evaluate the optimizations you design. Our approach to this problem is to collaborate with Ericsson: we base our implementation of Erlang on theirs, reusing those parts of their implementation that have no research value for us. In this way we can reduce, but certainly not eliminate, the effort needed for providing the infrastructure required by our research methodology.

Short-term goals

  1. Extend and rewrite our current Erlang implementation so that it is stable enough to run very large programs.
  2. Further develop our current measurement framework.
  3. Carry out extensive measurements on large Erlang applications, aiming for a precise understanding of their static and dynamic characteristics.
  4. Begin investigation into new optimizations, exploring the knowledge gained in experimentation.

Approach

To verify that our implementation of Erlang is stable enough to run very large programs, we will validate our implementation by means of a test suite provided by Ericsson's Open Telecom Platform division (OTP).

Our measurement framework will be extended to precisely measure time spent per function and identify the application kernel of procedures where the main portion of time is spent.

Measurements on large Erlang application will be carried out with the assistance of Ericsson's OTP division and Ericsson development projects. We will concentrate on the following aspects:
  1. Static characteristics, such as program size and complexity and available type information. This information guides static optimization efforts.
  2. Dynamic characteristics, based on measuring the executing system. These include determining where time is spent in the system, memory usage profiles, garbage collection overheads (pause times and total time overheads), concurrency characterization, and other similar aspects. This information guides system design choices and profile-based optimizations.
Based on this information, we will develop optimizations and prototype implementations suitable for very large programs. We intend to pursue these optimizations more fully in the continuation of the project.

Long-term perspectives

The task of a compiler is to utilize the hardware as efficiently as possible for a given source program. Hardware technology increasingly imposes two limits on performance: branches and memory references. In order to overcome these limitations, we intend to investigate techniques that reduce load/stores and branches for realistic sequential and concurrent programs.

Collaborations

Collaborations are currently in progress with the Computer Science Lab and the Open Telecom Platform division of Ericsson. There are two purposes of this collaboration: (1) it will facilitate the use of a proper scientific methodology in the project as explained above, and (2) it will introduce Ericsson to new efficient compilation optimization.
Thomas Lindgren / thomasl@csd.uu.se

Last modified: Wed Feb 11 15:04:52 MET 1998