• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletOutputStream v. PrintWriter

 
Nick Heudecker
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I was wondering if anyone has noticed a performance difference in servlets using a ServletOutputStream rather than a PrintWriter? What about the opposite?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A ServletOutputStream is intended for direct output without Unicode character translation so it should be faster than a PrintWriter. I got a neat book "Java Performance and Scalability - Server-side Programming Techniques" by Bulka - Addison Wesley in which he does some time tests - the PrintWriter approach is distinctly slower.
Bill
 
Nick Heudecker
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that. Saves me the time of having to do my own tests.
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also hear this book is getting good reviews among java developers. Yet to have a look personally
regds
maha anna
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic