B
Bruce Lee
Do frequent System.out calls hamper performance?
Yes, even a single one does. You should avoid the useDo frequent System.out calls hamper performance?
Do frequent System.out calls hamper performance?
Do frequent System.out calls hamper performance?
Ross said:[...] And output in general is _slow_ compared to
memory operations.
Well, System.out is synchronized, so yes, frequent calls will cause
some bottlenecking.
Ross Bamford coughed up:
*ONLY* if there are different threads attempting the
system.out.{whatever}at
the same time! It is a slow beast anyway, simply because it is i/o, but
you
may be misleading the newbie a little. A synchronized method doesn't
block
anything other than what it is synchronizing on, in this case all the
java.io.PrintStream methods synchronize on their own instances.
Ross said:[...] And output in general is _slow_ compared to
memory operations.
And output to a TTY (in Unix) or to a Windows "console" can be /very/ slow
even compared to I/O in general.
-- chris
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.