Differences From Artifact [98e2dc75e9]:
- File src/OFInflateStream.m — part of check-in [bceb7ed4c9] at 2019-03-08 00:35:48 on branch trunk — Use dot syntax (user: js, size: 16788) [annotate] [blame] [check-ins using]
To Artifact [5b9953e18a]:
- File
src/OFInflateStream.m
— part of check-in
[6a0bf8be32]
at
2019-03-20 21:04:36
on branch trunk
— Force inline tryReadBits and of_huffman_tree_walk
This gives a significant performance improvement, cutting decompression
time almost in half. (user: js, size: 16815) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
102 103 104 105 106 107 108 |
};
#endif
static const uint8_t codeLengthsOrder[19] = {
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
};
static struct of_huffman_tree *fixedLitLenTree, *fixedDistTree;
| | > | | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
};
#endif
static const uint8_t codeLengthsOrder[19] = {
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
};
static struct of_huffman_tree *fixedLitLenTree, *fixedDistTree;
static OF_INLINE bool
tryReadBits(OFInflateStream *stream, uint16_t *bits, uint8_t count)
{
uint16_t ret = stream->_savedBits;
assert(stream->_savedBitsLength < count);
for (uint_fast8_t i = stream->_savedBitsLength; i < count; i++) {
if OF_UNLIKELY (stream->_bitIndex == 8) {
if OF_LIKELY (stream->_bufferIndex <
stream->_bufferLength)
stream->_byte =
stream->_buffer[stream->_bufferIndex++];
else {
size_t length = [stream->_stream
readIntoBuffer: stream->_buffer
length: BUFFER_SIZE];
|
| ︙ | ︙ |