Using async queue instead of submit new Runnable each time#25
Using async queue instead of submit new Runnable each time#25maurofran wants to merge 8 commits intotim-group:masterfrom
Conversation
…n order to improve performance.
…n order to improve performance.
Conflicts: src/main/java/com/timgroup/statsd/NonBlockingStatsDClient.java
|
Thanks for submitting this. I was thinking of doing something similar myself as part of issue #16. Would it be possible for you to force-push a better pull request without tangential changes to the signature of I'm happy to review and consider pulling your request, but I don't like multiple things changing at once. I haven't looked in depth yet, but by using a |
|
Yes... I'have done few experiments (one used in order to also use StringBuilder instead of String.format) but it breaks the unit tests. |
|
OK, Thanks. Do have a check before you start, as I may make some changes for #16 in the next few days. |
|
A faster approach is using the lmax-disruptor See finn-no@5b0e893 Or the branch for this work, https://github.com/finn-no/statsd-lmax-disruptor-client/tree/feature/lmax-disruptor we've been using this in production at Norway's busiest website for 5 months now. |
|
I'm not sure I want to introduce a dependency on a 3rd party library like the lmax-disruptor. I like to think of the java-statsd-client as a small self-contained library without dependencies outside core Java. |
|
https://github.com/DataDog/java-dogstatsd-client appears to be a more actively maintained version of this project, I recommend submitting your patch there if you have not already done so. |
Looking at the code, I noticed that every time a message is sent to the statsd server, a new Runnable instance is created. I think better performance can be achieved using a single Runnable and a Queue in which messages are put, waiting to be sent to the statsd server.