Skip to content

Benchmarks have errors / problems... #242

Open
@JustinCappos

Description

@JustinCappos

When examining the benchmarks for rustposix, I noticed a few odd measurements that led me to find a few bugs in the benchmark scripts.

The overall problem is that return values were not being adequately validated. (Naively, I thought this was a good idea to limit the overhead of this checking in the benchmark.) This was masking bugs.

A few examples:

In many benchmarks, the file was opened write-only. This means that reads were faster than writes, with Lind far outperforming the kernel because it would error more quickly.

In the (common) case where writes are slower than reads, this means that a benchmark that writes into a file and then reads from it, can easily read to the end of the file and keep requesting bytes. This means iterations at the end will just measure the size of a 0 byte read, regardless of the actual read buffer size.

So, as a result, I will fix those issues in PRs and also update the style guidelines to require assertions in almost all cases so that these sorts of errors can be minimized in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions