Decode bit-packed integers
compressed_memory_read · compared across machine types · 8 Series on 8 machine types · AWS us-east-2
CPU
Order
| Compare | Machine | Variant | P50 | P99 | Rate | Unit cost | Runs |
|---|---|---|---|---|---|---|---|
| c8a.2xlarge | 19.83 ns | — | 51.63 GB/s | $0.00833 /GB/s·h | 89 | ||
| c8i.2xlarge | 24.30 ns | — | 42.13 GB/s | $0.00904 /GB/s·h | 89 | ||
| c6i.8xlarge | 51.53 ns | — | 19.87 GB/s | $0.0684 /GB/s·h | 89 | ||
| i4i.2xlarge | 51.68 ns | — | 19.81 GB/s | $0.0351 /GB/s·h | 89 | ||
| m6id.2xlarge | 51.79 ns | — | 19.77 GB/s | $0.024 /GB/s·h | 1 | ||
| m5.large | 59.18 ns | — | 17.30 GB/s | $0.00557 /GB/s·h | 91 | ||
| c8g.2xlarge | 76.55 ns | — | 13.38 GB/s | $0.0238 /GB/s·h | 4 | ||
| i4g.2xlarge | 96.20 ns | — | 10.64 GB/s | $0.058 /GB/s·h | 4 |
Compared:m5.largec8g.2xlargec8i.2xlarge
Run-to-run spread
time per 256 B block across counted RunsOver time
newest counted Runs, time per 256 B block(one request each to the data API)
What this measures
How fast one thread unpacks integers stored at a width of bits into 32-bit integers, the decode step of a compressed column, cycling through a pool of blocks blocks meant to come from memory rather than cache. Whether the pool exceeds the cache depends on the machine.
What it does not measure
- Only 8 bits per value is implemented. At that width, unpacking a value is widening one byte to a 32-bit integer, so the figure says nothing of other widths.
- Every repetition writes its 256 values to the same 1024-byte output array; only the packed input moves through the pool.
- Whether the pool is read from memory or from cache depends on its size and on the machine's caches, which the Run's dump sections
lscpuandsys_cpurecord. A pool that fits in a cache gives a cache figure.
Code & config
Benchmark docsSeries JSONc8i.2xlarge
39__attribute__((noinline))40static uint64_t decompress_one_block(compressed_ctx_t *ctx) {41 uint8_t *in = ctx->compressed + ctx->index * COMPRESSED_BYTES_PER_BLOCK;42 uint64_t checksum = 0;43 for (uint32_t i = 0; i < BLOCK_LEN; i++) {44 uint32_t v = (uint32_t)in[i];45 ctx->out[i] = v;46 checksum += v;47 }48 ctx->index++;49 if (ctx->index == ctx->blocks) ctx->index = 0;50 return checksum;// …53static uint64_t compressed_run(void *arg) {54 return decompress_one_block((compressed_ctx_t *)arg);55}// …106 lm_measure(compressed_run, &ctx);
Configuration
- benchmarkcompressed_memory_read
- buildstatic
- instancec8i.2xlarge
- regionus-east-2
- azuse2-az3
- params.bits8
- params.blocks1000000