I've debugged the code that tries to decompress a large
chunk of data. In my case the size of decompressed data was expected
to be ~4GB.
I've found that the following code
SmallString<0> Out; ... Out.resize(DecompressedSize);
takes too long. Instead of resize we can use the resize_for_overwrite here.
In Debug configuration Out.resize(0xffffffff) call takes 44,1s,
while Out.resize_for_overwrite(0xffffffff) takes 10.8s for me. I.e. speedup is ~4.08x.
For Release configuration the numbers are:
resize_for_overwrite takes ~1700 microseconds, resize takes ~1850000 microseconds.
I.e. the resize_for_overwrite is ~1088x times faster.
It is very noticable when decompression does not happen. E.g. when the compressed data
is corrupted. In this case the new Decompressor::resizeAndDecompress() finishes much faster.