This is a collection of benchmarks that aim to measure the performance of operating system primitives, such as process and thread creation.
To build the benchmarks you need a C compiler, meson and ninja.
mkdir out
cd out
meson --buildtype=release ../src
ninja
All benchmarks run their work for five seconds, and the fastest pass is reported.
Create 100 threads and wait for them to finish. Each thread does nothing (just return).
- POSIX:
pthread_create()
,pthread_join()
- WIN32:
_beginthreadex()
,WaitForSingleObject()
,CloseHandle()
Create 100 processes and wait for them to finish. Each process does nothing (just exit).
- Unix:
fork()
,waitpid()
- WIN32: Not implemented (Windows lacks the corresponding functionality).
Launch 100 programs and wait for them to finish. Each program does nothing (just exit).
- Unix:
fork()
,execlp()
,waitpid()
- WIN32:
CreateProcess()
,WaitForSingleObject()
,CloseHandle()
Create 65,534 files, write 32 byts of data to each file, and then delete them.
fopen()
,fwrite()
,fclose()
,remove()
NOTE: To measure filesystem/kernel performance rather than storage medium performance, consider using a RAM disk.
Allocate 1,000,000 small chunks of memory, and then free them. Each chunk is 4-128 bytes in size.
malloc()
,free()