From c692d9d9c99f0625aefca4a6ad191ffd80b5b215 Mon Sep 17 00:00:00 2001 From: sw1tchbl4d3 Date: Thu, 29 Jul 2021 18:38:33 +0200 Subject: [PATCH] Add benchmarks to the README.md I myself was astonished by the difference between rdo and doas, so I felt like including it in the README. --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index ae0243b..7d6cac9 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,39 @@ session_ttl=5 ### Dependencies - `libbsd` + +### Benchmarks + +The benchmark: Execute `whoami` 1000 times. + +|Program|Time| +--- | --- +sudo | 13.62s +opendoas | 7.60s +rdo | 2.25s +Baseline | 1.43s + +Baseline here is how long it took without any wrapper to make it root. + +These benchmarks were done on a single core of an `Intel i3-3110M` Laptop processor, on Artix Linux version `5.13.4-zen2-1-zen`. + +`sudo` and `opendoas` were pulled from the pacman repos, rdo via AUR. + +All configs were kept as default, except allow the `wheel` group on both + enable `persist` on doas. + +Script used: +```sh +#!/bin/sh + +$1 whoami + +current=$(date +%s.%N) +for i in {1..1000}; do + $1 whoami 2>&1 >/dev/null +done +done=$(date +%s.%N) + +echo $done - $current | bc +``` + +The script requires `bc` to be installed, for floating point arithmetics.