On Fri, 11 Sep 2020 at 20:48, Elliott Balsley <elliott@xxxxxxxxxxxxxx> wrote: > > I was trying to use fio in a Python script to get some benchmarks, and I compared fio measurements with psutil.disk_io_counters(). On Windows 10, there is a very large discrepancy, but on macOS it’s much closer. After some investigation, I think the problem is the measured runtime. Does anybody know why Windows thinks a command takes longer than fio says it did? > > For example on Windows Powershell: > > (Measure-Command {fio --name larry --rw write --size 1G --directory D\:\temp | Write-Host}).TotalMilliseconds > > Here, fio output shows run=4849-4849msec, while Measure-Command shows 6779ms (40% extra). > > On macOS a similar command: > time fio --name larry --rw write --size 4G --directory /var/tmp/ > > Here, fio output shows run=6200-6200msec, while time shows 6583ms (real). Only 6% extra. Process start/destruction overhead might be higher on Windows because it doesn't use fork. Also, some of the time is going to be consumed within fio doing things like creating the file, dropping the cache for it etc. which varies from OS to OS. Have you timed how long it takes to do fio --version or the smallest possible job? If the time is disappearing "within" fio you would have to do some profiling to work out just where it went. fio --thread --debug=all --name=test --size=4k will print lots of output (the job is purposely small to limit the output) but that output doesn't have timings so you would have to modify the fio source to find out just how much time was spent on each section. -- Sitsofe | http://sucs.org/~sits/