Compiler optimizations are interesting because they automatically
improve the efficiency of programs. Hand-optimization by a
programmer is a time consuming and notoriously error-prone activity,
so it is of the utmost importance for the compiler to make
correct optimizations automatically wherever possible.
Compiler optimization also serves as an important link between
theory and practice: many optimizations are made by proving certain
properties of programs -- for instance, that an array index cannot
be out of bounds or that a data structure is uniquely referenced --
and the relevant proof techniques are a valuable area of research in
themselves.
Ensuring that whole programs can be effectively optimized does
impose certain design constraints on the compiler and on the
programming language. The benefits of automatic optimization do,
however, far outweigh these relatively minor restrictions.
To me that is a reasonable perspective and I think it's widely held. My own real perspective is quite different, but it's nothing novel and can probably be summarised using catch-phrases:
Adequate performance
really comes from algorithms, data structures, profilers,
experience; the compiler itself is the program that most needs to be
simple and fast; whole-program analysis is the enemy of interactive
programming; the means seem to justify the ends for many optimizations
presented at conferences; I must trust my own experience more than
microbenchmarks and Socratic discourses on modern computer
architecture.
Of course this has absolutely nothing to do with type systems.
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 19 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago