We compare two procedures for automatically building a fast library
routine from a set of code fragments
1. These code fragments
solve the same problem (i.e., have identical inputs and outputs),
but we assume that each fragment has been performance-tuned for
different kinds of inputs. Suppose we are given a
sampling of possible inputs, and the execution times of each
algorithm on each sample input. Then, our procedure builds a
single library routine with static rules for quickly selecting a
code fragment. We compare two methods for learning these rules.
The first is an optimization based approach in which we try to
minimizing a particular cost function. The second method is based
on classifying the input space using support vector machines (SVMs).