R
Roedy Green
Connected
Unbuffered, one byte at a time: 1769.469
Done
Connected
Buffered, one byte at a time: 43.078
Done
Connected
Buffered, 1000 bytes at a time: 42.563
Done
Connected
UnBuffered, 1000 bytes at a time: 42.719
Done
so it would appear that a buffer bigger than 1K would not likely not
buy you any thing with buffering. It appears that a reading at least
two packet worths at a pop is sufficient buffering. I wonder how this
changes with much faster or slower lines. I would expect buffering
would be more profitable with high speed lines. With very slow ones
the time waiting for the i/o overshadows all else.
If you measured total CPU time, perhaps by running another low
priority task that sucked up all available CPU time while the main
thread was running, you could see which was more efficient that way.
It could do a tight loop and count how many times it iterated before
it was interrupted. Run it by itself to calibrate it.