]> git.ipfire.org Git - thirdparty/git.git/commit
test-tool genzeros: generate large amounts of data more efficiently
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 2 Nov 2021 15:46:05 +0000 (15:46 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Nov 2021 18:22:26 +0000 (11:22 -0700)
commitdf7000cd910a5f6991f73991b87d838a5d75e2fc
treec86f0b59fd5f40fdbb7fdecf80ce4058b6cf9767
parentcbc985a1f403a09dd22511aca3e6699d3f3c1c7c
test-tool genzeros: generate large amounts of data more efficiently

In this developer's tests, producing one gigabyte worth of NULs in a
busy loop that writes out individual bytes, unbuffered, took ~27sec.
Writing chunked 256kB buffers instead only took ~0.6sec

This matters because we are about to introduce a pair of test cases that
want to be able to produce 5GB of NULs, and we cannot use `/dev/zero`
because of the HP NonStop platform's lack of support for that device.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-genzeros.c