By tarun-dzone
via munchingjava.blogspot.com
Published: May 23 2011 / 01:39
| Core Spring Data | |
| Written by: Oliver Gierke | |
| Featured Refcardz: Top Refcardz: | |
| 150+ Refcardz Available · Get them all | |
By tarun-dzone
via munchingjava.blogspot.com
Published: May 23 2011 / 01:39
Comments
zynasis replied ago:
14 down votes without reason???
matthewdfleming replied ago:
It was probably voted down due to an inaccurate test (see comments on blog).
tarun-dzone replied ago:
Its not an inaccurate test, buffered streams use the buffer internally. Hence I did not use the buffer in first program. If you take the source code from the JAVA IO package for Buffered Streams and just remove the synchronized keywords from the code. You will see the difference.
I may be wrong but someone needs to prove with appropriate test code.
Kapil Jain replied ago:
Well I found an article whose benchmarks shows buffersteam have better performance http://www.precisejava.com/javaperf/j2se/IO.htm.
Btw I think default buffer size is 512 bytes
tarun-dzone replied ago:
In the article you have mentioned there are 3 key points mentioned at the end, I have tried to prove the same in my article.
Reading and writing data using default behavior of some streams that is byte by byte read/write causes slow performance.
Buffered input streams and buffered output streams increase performance.
Custom buffering increases performance significantly.
Kapil Jain replied ago:
yes, Tarun thats the point !!! One should look into the details first without blindly following the concept. Buffer streams are better than the default behavior but not when bytes are read directly. There is one more point regarding the custom buffering that it loads all the bytes in the memory so that might put load on the RAM.
Voters For This Link (8)
Voters Against This Link (18)