Overview
Comment: | Switched encoding/fibonacci.Encoder back to using a 2-bytes array as a preallocated write buffer. It seems that it otherwise escapes everytime and calls a causes a lot of allocations and subsequent gc work. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
90877fa64fa2a38e082a8eb74161a9a1 |
User & Date: | spaskalev on 2015-01-11 08:44:26 |
Other Links: | manifest | tags |
Context
2015-01-14
| ||
20:46 | Use for range in mtf's encoder for the position table. check-in: 3ea011cf07 user: spaskalev tags: trunk | |
2015-01-11
| ||
08:44 | Switched encoding/fibonacci.Encoder back to using a 2-bytes array as a preallocated write buffer. It seems that it otherwise escapes everytime and calls a causes a lot of allocations and subsequent gc work. check-in: 90877fa64f user: spaskalev tags: trunk | |
2015-01-10
| ||
21:28 | encoding/mtf optimizations check-in: 5c9c0a2164 user: spaskalev tags: trunk | |
Changes
Modified src/0dev.org/encoding/fibonacci/fib.go from [32c0b16287] to [ad0ff53aaf].
︙ | |||
98 99 100 101 102 103 104 105 106 107 108 109 110 111 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | + | var enc encoder enc.target = target return &enc } type encoder struct { target io.Writer buffer [2]byte remaining byte length byte } // Implements io.Writer func (e *encoder) Write(input []byte) (int, error) { var ( |
︙ | |||
141 142 143 144 145 146 147 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | - + | continue } // Clearing e.length is not necessary as it will be overwritten later // Stage the complete byte for writing |
︙ |