gemnasium / logrus-graylog-hook

Graylog hook for logrus
MIT License
87 stars 62 forks source link

Low performance due to GC on gzip/zlib writers #33

Closed jorygeerts closed 6 years ago

jorygeerts commented 6 years ago

The code in graylog.Writer.WriteMessage() constructs a new gzip/zlib writer for every message. This slows down the entire application (over 50% of my application time was spent in runtime.gcDrain()).

By only creating a gzip/zlib writer once, this overhead is removed, speeding everything up.

jorygeerts commented 6 years ago

@gravis From the looks of it, you seem in charge of this project. Could you take a look at my PR? Thanks! (Sorry to ping you like this, but I have no idea if you're being notified about issues and PRs.)

gravis commented 6 years ago

Thanks for your contribution, and sorry for being late on this. I will review that by the end of the week.