Skip to content

Checksum utilities, particularly sha1sum and sha256sum, slow compared to GNU coreutils #12251

@jabl

Description

@jabl

I tested the common checksumming utilities, and they seem significantly slower than the GNU ones. Note that the GNU coreutils tests were run on a bare metal Ubuntu 24.04 machine, and the uutils tests on a Ubuntu 26.04 VM running on the same HW, so some differences are expected, but this level would suggest significant optimization opportunities.

Results for GNU coreutils 9.4:

File: /tmp/checksum-bench-zi1p2vm0 (104,857,600 bytes (100.00 MiB))
Runs per utility: 5
Fastest: cksum (24.257 ms)

Utility         Best time      Ratio
---------- -------------- ----------
cksum           24.257 ms      1.00x
sha1sum        138.245 ms      5.70x
b2sum          176.584 ms      7.28x
md5sum         188.270 ms      7.76x
sha512sum      201.897 ms      8.32x
sha256sum      281.013 ms     11.58x

Running the same with uutils 8.0:

File: /tmp/checksum-bench-371wmgzt (104,857,600 bytes (100.00 MiB))
Runs per utility: 5
Fastest: cksum (33.813 ms)

Utility         Best time      Ratio
---------- -------------- ----------
cksum           33.813 ms      1.00x
b2sum          126.431 ms      3.74x
md5sum         237.955 ms      7.04x
sha512sum      301.289 ms      8.91x
sha1sum        482.523 ms     14.27x
sha256sum      963.138 ms     28.48x

One can see that uutils b2sum is actually faster than the coreutils one, most utilities are somewhat slower, but sha1sum and sha256sum in particular are a lot slower for the uutils versions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions