3 ms·
With that malloc overhead, I expect GNU yes to be slower when only a few bytes are read from it. So, what's the distribution of #bytes read for runs of 'yes'?
by Someone 9y ago
With that malloc overhead, I expect GNU yes to be slower when only a few bytes are read from it.
So, what's the distribution of #bytes read for runs of 'yes'? If we know that, is GNU 'yes' really faster than the simpler BSD versions?
Also, assuming this exercise still is somewhat worhtwhile, could startup time be decreased by creating a static buffer with a few thousand copies of "y\n"? What effect does that have on the size of the binary? I suspect it wouldn't get up much given that you can lose dynamic linking information (that may mean having to make a direct syscall, too).
- bonzini 9y agoUnless you are statically linking, one malloc doesn't significantly affect your startup time. When only a few y's are read, time is going to be dominated by ld.so, by a large margin.
- Sean1708 9y ago> I expect GNU yes to be slower when only a few bytes are read from it Wouldn't that be entirely negligible compared to starting the program in the first place?