Don't sort the first 127 entries in the string table.

Gives a small .1% gain. In my design, I try to use the smallest integers as
much as possible so that deflate's entropy coder works more efficiently.
This commit is contained in:
Scott Crosby 2010-09-02 14:22:41 -05:00
parent 4f013ebbfc
commit fbfba3bdea
1 changed files with 4 additions and 1 deletions

View File

@ -53,7 +53,10 @@ public class StringTable {
// Each group of keys that serializes to the same number of bytes is
// sorted lexiconographically.
// to maximize deflate compression.
Arrays.sort(set, Math.min(0, set.length-1), Math.min(1 << 7, set.length-1));
// Don't sort the first array. There's not likely to be much benefit, and we want frequent values to be small.
//Arrays.sort(set, Math.min(0, set.length-1), Math.min(1 << 7, set.length-1));
Arrays.sort(set, Math.min(1 << 7, set.length-1), Math.min(1 << 14,
set.length-1));
Arrays.sort(set, Math.min(1 << 14, set.length-1), Math.min(1 << 21,