DyC selectively dynamically compiles programs during their execution, utili
zing the run-time-computed values of variables and data structures to apply
optimizations that are based on partial evaluation. The dynamic optimizati
ons are preplanned at static compile time in order to reduce their run-time
cost; we call this staging. DyC's staged optimizations include (1) an adva
nced binding-time analysis that supports polyvariant specialization (enabli
ng both single-way and multiway complete loop unrolling), polyvariant divis
ion, static loads, and static calls, (2) low-cost, dynamic versions of trad
itional global optimizations, such as zero and copy propagation and dead-as
signment elimination, and (3) dynamic peephole optimizations, such as stren
gth. reduction. Because of this large suite of optimizations and its low dy
namic compilation overhead, DyC achieves good performance improvements on p
rograms that are larger and more complex than the kernels previously target
ed by other dynamic compilation systems. This paper evaluates the benefits
and costs of applying DyC's optimizations. We assess their impact on the pe
rformance of a variety of small to medium-sized programs, both for the regi
ons of code that are actually transformed and for the entire application as
a whole. Our study includes an analysis of the contribution to performance
of individual optimizations, the performance effect of changing the applic
ations' inputs, and a detailed accounting of dynamic compilation costs.