chibenwa opened a new pull request #442:
URL: https://github.com/apache/james-project/pull/442


   MDCBuilder::addContext does an implicit call to Object::toString
   
   We do not want that for two reasons:
   
    - 1. Formatting. For instance ` {"user":"btellier@erugerkuf"} ` instead
         of simply `btellier@erugerkuf`.
   
    - 2. Performance.
   
   See the attached flame graphs: James spends ~1.20% of CPU calling
   Object::toString which correlate closely to MDCBuilder::addContext.
   This crosses the "valuable to optimize" threshold. Especially calls
   to MoreObject::toStringHelper(this) are not negligible.
   
   ![Screenshot from 2021-05-19 
21-13-46](https://user-images.githubusercontent.com/6928740/118830753-5fdad600-b8e9-11eb-89ed-db0904f242df.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to