Methods and apparatus for performing adaptive compression are disclosed. A
data stream is divided into a plurality of data segments. When one of the
plurality of data segments is compressed, it is determined whether the
compression has been successful. When the compression has been
successful, a data segment in proximity to the compressed segment (e.g.,
the next data segment in the plurality of data segments) is compressed.
However, when the compression has been unsuccessful, one or more of the
plurality of data segments are skipped (i.e., not compressed) before
compression is attempted on another one of the plurality of data
segments. When a data segment is compressed, the compression algorithm
(and any associated parameter(s)) that is applied is selected based upon
a variety of factors, such as the length of the data segment, CPU speed,
CPU availability, and/or data throughput such as the network bandwidth or
network availability (e.g., where data is to be transmitted via a network
interface). The compression algorithm (and any associated parameter(s))
may also be selected, at least in part, based upon a set of user
preferences that indicate a preference between the speed with which
compression is performed and the amount that a data segment is
compressed.