nodejs-logging-winston icon indicating copy to clipboard operation
nodejs-logging-winston copied to clipboard

Performance

Open tgensol opened this issue 3 years ago • 1 comments

Hi there,

We were trying to understand why our NodeJS app (express) was slow to launch (9s), and after using tracing and https://github.com/davidmarkclements/0x we found that this library was in the top of our costing dependencies :

  • Capture d’écran 2022-07-19 à 11 06 45
  • the require("@google-cloud/logging-winston") on my local machine (300ms) or on a Cloudrun (+1s) is also in the top :

Capture d’écran 2022-07-19 à 11 08 27

Do you think we could improve the importation of this library ? Are we doing something wrong ? Thank you

tgensol avatar Jul 19 '22 09:07 tgensol

@tgensol , thanks a lot for opening this issue! To clarify - is the slowdown happens only on startup?

losalex avatar Aug 29 '22 20:08 losalex

@tgensol , I submitted a fix recently to add instrumentation only once and avoid any further inspection of logging payload - please let me know if things improved overall for you. Feel free to reopen this work item if things are not got better - thank you!

losalex avatar Oct 14 '22 18:10 losalex