|
|
|
|
|
by microtherion
3297 days ago
|
|
This works easily for the default case, which prints "y\n" (two bytes), which is likely to divide BUFSIZ. To handle the general case with the same efficiency, you have to have a buffer size that is a multiple of both BUFSIZ and the length of the string to be printed. It appears that GNU yes will not do that and simply does unaligned writes in this case, which is likely to be considerably slower (possibly slower than write would have been). |
|
Why would it be slower to do a single, say, 8190 bytes write instead of 2730 3-byte writes?