Repository navigation
Conversation
| fluent = { workspace = true } | ||
| memchr = { workspace = true } | ||
| uucore = { workspace = true, features = ["i18n-charmap", "parser", "ranges"] } | ||
| whichever = { workspace = true } |
There was a problem hiding this comment.
We don't prefer new dependency just for this.
There was a problem hiding this comment.
thank you for such a quick response!
that’s fair! I’ll update this PR with a hand-written version in uucore::io then.
it'll still forward write_all and the rest, since that’s what made #13075 slower.
just wanted to show that it can be done this way in case it’s helpful.
There was a problem hiding this comment.
did it here:
https://github.com/uutils/coreutils/pull/16408/changes
ofc, feel free to close both if that doesn't really bring much
There was a problem hiding this comment.
Please don't open new PR. Rebase this PR instead.
1291ac0 to
7d210ea
Compare
Merging this PR will improve performance by 39.81%2 warnings, 1 note
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
7d210ea to
ed76ec9
Compare
|
GNU testsuite comparison: |
ed76ec9 to
d9c9f4c
Compare
|
thanks for the work on this! |
| fluent = { workspace = true } | ||
| memchr = { workspace = true } | ||
| uucore = { workspace = true, features = ["i18n-charmap", "parser", "ranges"] } | ||
| uucore = { workspace = true, features = ["fs", "i18n-charmap", "parser", "ranges"] } |
There was a problem hiding this comment.
do we really need the whole fs feature just for uucore::io? it only exists on unix/windows/wasi
There was a problem hiding this comment.
good point, it didn't need it. OutputWriter (and InputReader) are plain std::io, only RawReader/RawWriter and OwnedFileDescriptorOrHandle actually need rustix and the fd/handle types.
so uucore::io is now always compiled and the fs + platform gate sits only on those items. cut doesn't need fs anymore, so it builds on any target again.
that also took care of the red "check": it was taplo wanting the longer features line split, and cut's Cargo.toml is back to what's on main.
Only the file descriptor and handle types need fs; InputReader, OutputWriter, ReadWriteError and read_and_discard are plain std::io.
51b9417 to
3273ad5
Compare
part of #11811.
#13075 tried this but got slower, because its enum only forwarded
writeandflush.cut writes through
write_all, and the trait's defaultwrite_allloops overwrite,while
BufWriterhas its own that just copies into the buffer.so this one forwards all of
Write's methods.the enum lives in
uucore::ionext toInputReader, so other utils can use it too.on my M1 Pro it's 5-21% faster than
Box<dyn Write>, output is identical:Box<dyn Write>-b 1-20-c 5-30mixed, UTF-8-f 2,4tab