reinh/statsd — pull request #50 by quirkey (2014-03-05 20:48:08+00:00)
Title: Add the ability to pre-connect to the UDPSocket with `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

```
user system total real
udp with connect 0.010000 0.000000 0.010000 ( 0.074522)
udp without connect 0.120000 0.530000 0.650000 ( 13.096515)
statsd with connect 0.000000 0.090000 0.090000 ( 0.103520)
statsd without connect 0.100000 0.620000 0.720000 ( 13.483539)
```