alouca/gosnmp — pull request #26 by mordyovits (2014-03-21 16:31:55+00:00)
Title: Optimize oidToString

In profiling my own program, I found a lot of time spent in oidToString. The problem is that it's a) calling Sprintf for every octet in the oid and b) doing string concat for every oid. This patch fixes that.

the one thing I don't like about my patch is that it copies the []int to a []interface{}. It does that so it can be passed to the variadic Sprintf function. I'm new to Go, so maybe I just don't know a better way to do that "cast to []interface{}". At least it doesn't need to expand the values slice.