Theseus icon indicating copy to clipboard operation
Theseus copied to clipboard

Add a benchmarking mode

Open tsoutsman opened this issue 2 years ago • 3 comments

Currently, benchmarking fundamental subsystems (e.g. the task subsystem) is hard. It'd be nice to have a configuration option to run a benchmarking application rather than the shell at startup. The mode would minimise the number of tasks spawned before the benchmark is run, improving the accuracy of benchmarks.

Ideally, there'd also be some automation to repeat benchmark runs, calculating averages, standard deviations, etc.

tsoutsman avatar Dec 20 '22 14:12 tsoutsman

Which of the subsystems are fundamental? Is it all the crates in the kernel directory?

I think flamegraph seems like a good choice of benchmarking tool. It can help us see at a glance where performance bottlenecks exist in the OS. Do you agree with my recommendation?

amab8901 avatar Dec 21 '22 04:12 amab8901

Which of the subsystems are fundamental? Is it all the crates in the kernel directory?

Mostly just the task subsystem. It's hard to test because everything is a task, and so any tasks not relevant to the benchmark impact the benchmark. For example, in #759 the benchmark tasks have to be pinned to core 3 so that they don't yield to the shell task.

I think flamegraph seems like a good choice of benchmarking tool. It can help us see at a glance where performance bottlenecks exist in the OS. Do you agree with my recommendation?

Flamegraph relies on perf or dtrace depending on the OS, neither of which are available on Theseus. Porting them would be non-trivial.

tsoutsman avatar Dec 21 '22 14:12 tsoutsman

I found another benchmarker: bencher. It seems to be very lightweight with minimal dependencies (if any at all). Would this be a good choice?

amab8901 avatar Dec 21 '22 14:12 amab8901