A data compressor, comprising: an LZ77 compression engine that scans an initial fraction of an input block of characters and produces tokens of the initial fraction of the input block, wherein when the LZ77 compression engine scans the initial fraction of the input block, the data compressor concurrently uses a plurality of pre-compiled Huffman code tables to compute the sizes of the corresponding outputs that would be generated by using each of the plurality of pre-compiled Huffman code tables to Huffman encode the initial fraction of the input block, and wherein when the LZ77 compression engine finishes scanning the initial fraction of the input block, the data compressor selects the pre-compiled Huffman code table that encodes the initial fraction to the smallest output to be a selected pre-compiled Huffman code table; and a Huffman encoding engine that receives tokens of the entire input block produced by the LZ77 compression engine and Huffman encodes the tokens of the entire input block using the selected pre-compiled Huffman code table to generate a compressed output block, wherein the tokens are either literal characters or a back pointer to replace matching strings of literal characters; wherein the LZ77 compression engine is configured to determine a first number of bits into which matching strings of literal characters of the input block would be Huffman encoded as literals using a reference pre-compiled Huffman code table, and to determine a second number of bits into which the back pointer replacing the matching strings of literal characters of the input block would be Huffman encoded using the reference pre-compiled Huffman code table, wherein the Huffman encoding engine is configured to Huffman encode each of the tokens of the entire input block using the selected pre-compiled Huffman code table, wherein the tokens of the entire input block comprise the matching strings of literal characters when the first number is less than the second number and otherwise comprise the back pointer, and wherein the reference pre-compiled Huffman code table is different from the selected pre-compiled Huffman code table. an LZ77 compression engine that scans an initial fraction of an input block of characters and produces tokens of the initial fraction of the input block, wherein when the LZ77 compression engine scans the initial fraction of the input block, the data compressor concurrently uses a plurality of pre-compiled Huffman code tables to compute the sizes of the corresponding outputs that would be generated by using each of the plurality of pre-compiled Huffman code tables to Huffman encode the initial fraction of the input block, and wherein when the LZ77 compression engine finishes scanning the initial fraction of the input block, the data compressor selects the pre-compiled Huffman code table that encodes the initial fraction to the smallest output to be a selected pre-compiled Huffman code table; and a Huffman encoding engine that receives tokens of the entire input block produced by the LZ77 compression engine and Huffman encodes the tokens of the entire input block using the selected pre-compiled Huffman code table to generate a compressed output block, wherein the tokens are either literal characters or a back pointer to replace matching strings of literal characters; wherein the LZ77 compression engine is configured to determine a first number of bits into which matching strings of literal characters of the input block would be Huffman encoded as literals using a reference pre-compiled Huffman code table, and to determine a second number of bits into which the back pointer replacing the matching strings of literal characters of the input block would be Huffman encoded using the reference pre-compiled Huffman code table, wherein the Huffman encoding engine is configured to Huffman encode each of the tokens of the entire input block using the selected pre-compiled Huffman code table, wherein the tokens of the entire input block comprise the matching strings of literal characters when the first number is less than the second number and otherwise comprise the back pointer, and wherein the reference pre-compiled Huffman code table is different from the selected pre-compiled Huffman code table.