Performance of BufferedOutputStream.write() 2005-01-07 - By Frans Verhoef
Back >?The reason I ask is that I don't want to fix it (i.e. implement >?your solution) if all I will get is a 5% performance improvement. >?I'm in need of a >2x performance benefit :(
I did a little test myself, transferring a file (about 300kb) from one harddisk to another using both methods. Method1 first loading the whole file, before streaming it to the new location, and method2 streams to the new location while streaming in from the file.
Method2 finishes the transfer consistently in 12-14 micro seconds. In about half the times method 1 also finishes in 12-14 micro seconds. However, the other times it can take as long as 90 microseconds.
Probably the reason behind it is that due to the big amounts of data you keep on loading into the virtual machine, the garbage collector needs more time to clear the heap.
Maybe you could try to make a little test servlet to test the two different methods in a servlet environment.
Hope its helpful.
Frans
==========================================================================To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|