On 23/10/2025 19:44, Collin Funk wrote:
Pádraig Brady <[email protected]> writes:
I think xposix-spawn... could be overkill as those functions
are generally not sprinkled throughout a code base,
rather concentrated in certain functions.
However we could consolidate the calls to "init" and "setup" groups,
which reduces the error() calls and also makes translators job easier.
The attached does that, which you can squash into your change if you agree.
Thanks, I pushed it with those changes [1].
Collin
[1]
https://github.com/coreutils/coreutils/commit/ca8b92866579fe87aeb6d4e93f3bfc07457e2367
Cool. Some quick benchmarks shows about a 10% efficiency win,
and that should go up for larger memory usage in the original process.
$ time ~/git/coreutils/src/split --filter=true -n5000 /dev/null
real 0m6.278s
user 0m2.399s
sys 0m3.825s
$ time /bin/split --filter=true -n5000 /dev/null
real 0m7.476s
user 0m2.724s
sys 0m4.663s
$ time SHELL=/bin/true ~/git/coreutils/src/split --filter=foo -n5000 /dev/null
real 0m2.771s
user 0m1.571s
sys 0m1.204s
$ time SHELL=/bin/true /bin/split --filter=foo -n5000 /dev/null
real 0m3.036s
user 0m1.517s
sys 0m1.498s
$ time seq 5000 | xargs -n1 true
real 0m4.251s
user 0m1.628s
sys 0m2.705s
$ time seq 5000 | xargs -n1 /bin/true
real 0m3.719s
user 0m1.621s
sys 0m2.167s
cheers,
Padraig