Patent ID: 7843823

Claim:
An apparatus, comprising: one or more processors; and one or more stored instructions which, when executed by the one or more processors, cause: for each message of a plurality of successive messages, performing steps comprising: receiving the message of the plurality of successive messages; applying a first compression mechanism to the message to generate a first compressed message, wherein applying the first compression mechanism comprises gathering compression information; based on the compression information, computing a compression metric that is associated with the first compressed message; comparing the compression metric to a threshold value; applying a second compression mechanism to the first compressed message to generate a second compressed message only when the compression metric does not exceed the threshold value; not applying the second compression mechanism to the first compressed message when the compression metric exceeds the threshold value; wherein, for at least two different messages of the plurality of successive messages, different decisions are made of whether to apply the second compression mechanism; and periodically performing steps comprising: determining whether a decision not to apply the second compression mechanism to a particular message of the plurality of successive messages is correct; and modifying the threshold value when the decision is not correct.