restore ZBUFF full-block-size, for better performance on small input

This commit is contained in:
Yann Collet 2016-06-03 23:09:28 +02:00
parent a49c1f1782
commit f4f5affdf7
2 changed files with 3 additions and 4 deletions

View File

@ -147,7 +147,7 @@ size_t ZBUFF_compressInit_advanced(ZBUFF_CCtx* zbc,
zbc->inBuff = (char*)zbc->customMem.customAlloc(zbc->customMem.opaque, neededInBuffSize);
if (zbc->inBuff == NULL) return ERROR(memory_allocation);
}
zbc->blockSize = MIN(ZSTD_BLOCKSIZE_MAX, neededInBuffSize/2);
zbc->blockSize = MIN(ZSTD_BLOCKSIZE_MAX, neededInBuffSize);
}
if (zbc->outBuffSize < ZSTD_compressBound(zbc->blockSize)+1) {
zbc->outBuffSize = ZSTD_compressBound(zbc->blockSize)+1;

View File

@ -832,9 +832,8 @@ static size_t ZSTD_decompressSequences(
FSE_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && nbSeq ; ) {
seq_t sequence;
nbSeq--;
sequence = ZSTD_decodeSequence(&seqState);
{ seq_t const sequence = ZSTD_decodeSequence(&seqState);
#if 0 /* debug */
static BYTE* start = NULL;
@ -845,7 +844,7 @@ static size_t ZSTD_decompressSequences(
pos, (U32)sequence.litLength, (U32)sequence.matchLength, (U32)sequence.offset);
#endif
{ size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litLimit_8, base, vBase, dictEnd);
size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litLimit_8, base, vBase, dictEnd);
if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
op += oneSeqSize;
} }