Closed quirkey closed 8 years ago
I tried this at one point, but it was rejected for a few (valid) reasons. See the discusson on #30.
@cheald Ah! thanks for the heads up, great info. I still think this patch is useful/valid even though it puts some restrictions on the connection itself. Either way, its optional and lets the user choose if they want to skip the re-connect.
In testing with a previous version of the statsd-ruby gem we noticed that a lot of time was spent sending these UDP messages. Looking at the Ruby API, I noticed that by calling
connect
on the socket ahead of time, future sends on the socket were significantly faster.This adds a
connect
method, that when called, no longer needs to send host/port with every send.In testing in production, it has reduced calls by greater than two orders of magnitude