Sorry - I really thought this would be a throw-away for the one blog post.
Time measured in nanoseconds using:
uint64_t nano() {
return std::chrono::duration_cast< ::std::chrono::nanoseconds>(
std::chrono::steady_clock::now().time_since_epoch())
.count();
}
Huge global buffers are used:
char input_buffer[64 * 1024 * 1024];
char output_buffer[64 * 1024 * 1024];
The output-size passed to the compressors is that huge-buffer size, whereas the input-size is the file size to time slow path behaviour. Actually some benchmark code for some compressors got this mixed up, but slow-path behaviour only makes a measurable difference on smaller files - retiming with this corrected did not change the results.
zlib-like compressors are called via the int uncompress(Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen);
API.
isa-l was called via:
int isal_uncompress(void *out, size_t *size, void *in, size_t insize) {
struct inflate_state state;
isal_inflate_init(&state);
state.next_out = (uint8_t *)out;
state.avail_out = *size;
state.next_in = (uint8_t *)in;
state.avail_in = insize;
state.crc_flag = ISAL_ZLIB;
int status = isal_inflate_stateless(&state);
if (status != ISAL_DECOMP_OK) {
printf("isal_inflate_stateless failed %d\n", status);
return 1;
}
*size = state.total_out;
return 0;
}
Take minimum of some number of runs (based on reciprocal of size):
File | Runs |
---|---|
xml | 100 |
reymont | 53 |
ooffice | 32 |
nci | 31 |
mr | 27 |
osdb | 27 |
dickens | 25 |
sao | 18 |
samba | 18 |
x-ray | 16 |
webster | 8 |
mozilla | 5 |
Minimum gets consistent numbers on Firestorm, but for Icestorm testing it seems that sometimes the process can still be scheduled onto Firestorm cores, so median (well, sorted_times[num_runs/2]
) is used instead.
Megabytes are decimal, not mibibytes.
Speed is measured in compressed/input megabytes per second, not uncompressed/output megabytes per second. Only uncompression speed (not compression speed) is measured.
Reported overall differences use the geometric mean of the speedup for each individual file in the corpus.