whisper.cpp
whisper.cpp copied to clipboard
Add process-specific timings
Adds functions that use CLOCK_PROCESS_CPUTIME_ID
instead of CLOCK_MONOTONIC
for timings, and are therefore not affected by other processes on the system.
One thing to check before we merge: since the time is per-process, the time reported is n_threads
times more than realtime since each active thread adds to the timings - should we adjust for this?
Also updated bench-all to include information about the measured parameters, better formatting and better configuration detection.
Closes #382.
@abitofevrything Can you verify that everything is good on Windows? After that I will merge it
Tested on my Windows machine and there seems to be some issues with using clock()
. Apparently its implementation is OS-specific and on Windows it returns wall clock time instead of process time.
Apparently there is a GetProcessTimes
to get process time, but I'll need to look into that later.
Well, I changed the implementation to use GetProcessTimes but the issue with the timing still persists: process time is sometimes counted as negative.
I'm pretty sure this is an underflow/overflow issue, or an issue with the wrong data type being used somewhere, but I don't have a setup to debug this. I'll see what I could do, but if anyone used to windows development has any idea what is happening here I'd be glad if you could let me know.