ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.71k stars 2.85k forks source link

Performance improvement: no useless JSON.stringify #4551

Closed webzwo0i closed 3 years ago

webzwo0i commented 3 years ago

I stumbled upon this again, so for future TODO stuff:

A lot of CPU cycles are wasted due to JSON.stringify in log4js expressions, when in fact the loglevel makes the message never appear.

This happens for socket.io messages, but also in ueberDB. The code

logger.debug("This is a debug message", JSON.stringify(an_object_that_might_be_big))

needs to be changed to

if (loglevel above debug) logger.debug("This is a debug message", JSON.stringify(an_object_that_might_be_big))
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.