System call
syscall · compared across machine types · 32 Series on 8 machine types · AWS us-east-2
CPU
Call
Path
Order
| Compare | Machine | Variant | P50 | P99 | Unit cost | Runs |
|---|---|---|---|---|---|---|
| c8a.2xlarge | none | 39.81 ns | — | $0.00000472 /1M ops | 89 | |
| c8i.2xlarge | none | 60.95 ns | — | $0.00000636 /1M ops | 89 | |
| c8g.2xlarge | none | 86.70 ns | — | $0.00000766 /1M ops | 4 | |
| c6i.8xlarge | none | 93.23 ns | — | $0.0000352 /1M ops | 89 | |
| m6id.2xlarge | none | 93.25 ns | — | $0.0000123 /1M ops | 1 | |
| i4i.2xlarge | none | 93.25 ns | — | $0.0000178 /1M ops | 89 | |
| i4g.2xlarge | none | 120.2 ns | — | $0.0000206 /1M ops | 4 | |
| m5.large | none | 423.9 ns | — | $0.0000113 /1M ops | 91 |
Compared:m5.largec8g.2xlargec8i.2xlarge
Run-to-run spread
time per call across counted RunsOver time
newest counted Runs, time per call(one request each to the data API)
What this measures
The cost of one call into the kernel on one thread (getpid, getrusage, and stat, whose cost depends on the file system that answers it, which each Run observes), beside gettimeofday, which the vDSO normally answers without entering the kernel; whether it did is not observed, and the Run's dump section kernel records the clock source.
What it does not measure
gettimeofdaynormally does not enter the kernel, and whether it did is not observed; the Run's dump sectionkernelrecords the clock source.- With
callstat, every repetition stats the same path. The cost ofstatdepends on the file system that answers it, whichpath_fs_typerecords. - The binary is linked statically, which changes how
gettimeofdayis reached. In two measurements on a development machine it cost more than in a dynamically linked binary (see "Findings").
Code & config
Benchmark docsSeries JSONc8i.2xlarge · getpid · none
42__attribute__((noinline))43static uint64_t syscall_getpid_run(void *arg) {44 syscall_ctx_t *ctx = (syscall_ctx_t *)arg;45 long pid = syscall(SYS_getpid);46 if (pid < 0) lm_die("syscall(SYS_getpid): %s", strerror(errno));47 ctx->checksum += (uint64_t)pid;48 return ctx->checksum;49}// …108 lm_measure(run, &ctx);
Configuration
- benchmarksyscall
- buildstatic
- instancec8i.2xlarge
- regionus-east-2
- azuse2-az3
- params.callgetpid