perf: huge refactoring
commit3bd747587973aa824a1405a1ff9753641ff0fedc
authorVojtech Horky <vojtech.horky@gmail.com>
Fri, 28 Dec 2018 09:32:11 +0000 (28 10:32 +0100)
committerVojtech Horky <vojtech.horky@gmail.com>
Fri, 28 Dec 2018 09:32:11 +0000 (28 10:32 +0100)
treef2333566f1bffc7d682b977839efc89dbe33aa93
parent8ee106b96f359e4491128a4081824a5a3f07983b
perf: huge refactoring

The overall aim of this refactoring was to remove duplicate code in all
benchmarks that was responsible (a) for computing proper workload size
and (b) for computing final statistics.

After the refactoring, the actual benchmark code is quite short and
takes care of the actual work only.

The harness code was factored out into perf.c that is now responsible
for computing the workload size and then runs the actual benchmark.

As an extra feature, we pass stopwatch_t into the benchmark code that is
only responsible for starting/stopping. Duration is then queried outside
the benchmark code.
uspace/app/perf/ipc/ns_ping.c [copied from uspace/app/perf/perf.h with 74% similarity]
uspace/app/perf/ipc/ns_ping.def
uspace/app/perf/ipc/ping_pong.c [copied from uspace/app/perf/perf.h with 59% similarity]
uspace/app/perf/ipc/ping_pong.def
uspace/app/perf/malloc/malloc1.c [copied from uspace/app/perf/perf.h with 75% similarity]
uspace/app/perf/malloc/malloc1.def
uspace/app/perf/malloc/malloc2.c [copied from uspace/app/perf/perf.h with 63% similarity]
uspace/app/perf/malloc/malloc2.def
uspace/app/perf/perf.c
uspace/app/perf/perf.h