Sort 1 MiB
sort · 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 | 857.3 µs | — | 1.223 GB/s | $0.102 /1M ops | 89 | ||
| c8g.2xlarge | 1.580 ms | — | 663.8 MB/s | $0.14 /1M ops | 4 | ||
| c8i.2xlarge | 1.680 ms | — | 624.0 MB/s | $0.175 /1M ops | 89 | ||
| i4g.2xlarge | 2.832 ms | — | 370.3 MB/s | $0.485 /1M ops | 4 | ||
| i4i.2xlarge | 2.853 ms | — | 367.6 MB/s | $0.544 /1M ops | 89 | ||
| c6i.8xlarge | 2.857 ms | — | 367.0 MB/s | $1.05 /1M ops | 89 | ||
| m6id.2xlarge | 2.909 ms | — | 360.5 MB/s | $0.383 /1M ops | 1 | ||
| m5.large | 3.289 ms | — | 318.8 MB/s | $0.0878 /1M ops | 91 |
Compared:m5.largec8g.2xlargec8i.2xlarge
Run-to-run spread
time per 1 MiB sort across counted RunsOver time
newest counted Runs, time per 1 MiB sort(one request each to the data API)
What this measures
How fast one thread sorts 64-bit integer keys: a copy of size_bytes of unsorted keys, sorted by an LSD radix sort.
What it does not measure
- The radix sort makes eight passes whatever the keys are. A sort that compares keys is not measured.
- The keys are bare 64-bit integers, with no records attached.
- Each repetition also copies the input, and reads a sample of the sorted keys for its checksum, so the figure is not the sort alone.
Code & config
Benchmark docsSeries JSONc8i.2xlarge
46static void radix_sort_u64(uint64_t *values, uint64_t *tmp, size_t len) {// …52 for (unsigned shift = 0; shift < 64; shift += 8) {53 memset(counts, 0, sizeof(counts));54 for (size_t i = 0; i < len; i++) {55 counts[(in[i] >> shift) & 0xffU]++;56 }// …64 for (size_t i = 0; i < len; i++) {65 unsigned bucket = (unsigned)((in[i] >> shift) & 0xffU);66 out[offsets[bucket]++] = in[i];67 }// …99__attribute__((noinline))100static uint64_t sort_run(void *arg) {101 sort_ctx_t *ctx = (sort_ctx_t *)arg;102 memcpy(ctx->scratch, ctx->input, ctx->len * sizeof(uint64_t));103 radix_sort_u64(ctx->scratch, ctx->tmp, ctx->len);104 return checksum_u64(ctx->scratch, ctx->len);105}// …131 lm_measure(sort_run, &ctx);
Configuration
- benchmarksort
- buildstatic
- instancec8i.2xlarge
- regionus-east-2
- azuse2-az3
- params.size_bytes1048576