There are use cases for logging to standard out/err and redirecting to a
file or something else than an actual console. It would be good if we would
optimize so that is not 50x slower than logging directly to file.

On Wed, May 25, 2016 at 4:09 PM, Remko Popma <remko.po...@gmail.com> wrote:

>
>
> On Wednesday, May 25, 2016 at 3:02:33 AM UTC+9, Richard Warburton wrote:
>>
>> Hi,
>>
>> Could we avoid that by using FileDescriptor.out / FileDescriptor.err
>>> instead of System.out / System.err ?
>>>
>>> On Tue, May 24, 2016 at 4:09 PM, Matt Sicker <boa...@gmail.com> wrote:
>>>
>>>> All the PrintStream.write() methods have locks.
>>>>
>>>> On 24 May 2016 at 02:56, Mikael Ståldal <mikael....@magine.com> wrote:
>>>>
>>>>> Do we know why Console has so bad performance (compared to File)? Is
>>>>> this true also if you redirect STDOUT to a file?
>>>>>
>>>>
>> There's a couple of other things to consider:
>>
>>  * Console writes in Java flush on every newline.
>>  * The terminal that is being written to might also spend time rendering
>> text, if your benchmark actually writes STDOUT. I've seen terminals eat 3x
>> more CPU rendering logs than a program was using to produce them.
>>
> Is rendering the bottleneck? I'm just wondering what causes this. The 50x
> difference with writing to a file is staggering... (I haven't benchmark
> File I/O when flushing on every write, may be interesting to try.)
>
>
>> regards,
>>
>>   Richard Warburton
>>
>>   http://insightfullogic.com
>>   @RichardWarburto <http://twitter.com/richardwarburto>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-dev-h...@logging.apache.org
>



-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.stal...@magine.com
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Reply via email to