Changes In Branch decompressor2 Through [e9b80a705b] Excluding Merge-Ins
This is equivalent to a diff from 1a4bdf36e2 to e9b80a705b
2014-12-22
| ||
16:35 | Decompressor - try to fill as much as possible in the output buffer in a single pass. Closed-Leaf check-in: 42ba1f458d user: spaskalev tags: decompressor2 | |
15:34 | Fixed a nasty variable shadowing bug :) check-in: e9b80a705b user: spaskalev tags: decompressor2 | |
14:23 | Read available bytes and the end of the buffer and decompress in a singe pass check-in: ae0940d072 user: spaskalev tags: decompressor2 | |
2014-12-21
| ||
22:52 | Removed TODOs, renamed readCount->rc, wrapped->reader check-in: 630530df49 user: spaskalev tags: trunk | |
22:12 | Check in the new decompressor implementation in a separate branch check-in: bd1368b81f user: spaskalev tags: decompressor2 | |
19:38 | Added debug/pprof to ease basic cpu profiling check-in: 1a4bdf36e2 user: spaskalev tags: trunk | |
17:23 | Fixed a rare case of losing data from the decompressor's internal result buffer. check-in: 7b74fd57f8 user: spaskalev tags: trunk | |
Modified src/0dev.org/predictor/predictor.go from [d2a3bd9d21] to [219e9c8a2d].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | + | // Package predictor implements the predictor compression/decompression algorithm // as specified by RFC1978 - PPP Predictor Compression Protocol package predictor import ( bits "0dev.org/bits" "io" ) type context struct { table [1 << 16]byte input []byte hash uint16 |
︙ | |||
68 69 70 71 72 73 74 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - | return err } // ... and stage the rest of the data in the buffer ctx.input = append(ctx.input, data[blockSize-bufferLength:]...) return nil } |
︙ | |||
115 116 117 118 119 120 121 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | - + - - - + + + - + - - + + - + - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + - - + - - - - + - - - - + - - - - - + + + - + - - - + + + + - + | // Required to implement io.Reader func (r decompressor) Read(output []byte) (int, error) { return r(output) } // Returns an io.Reader implementation that wraps the provided io.Reader // and decompresses data according to the predictor algorithm |