Native methods are really fast . This sounds silly, but I had heard that the overhead of invoking a native method was so high that it might be the case that small Java methods would be faster. In my test case, I implemented System.arraycopy in plain Java. I then compared this using arrays of different sizes against System.arraycopy . The native-method overhead may be high, but they're still fast compared to interpreting byte code.
String operations are fast .
However, String operations can hide a lot of new operations. It creates a lot of intermediate strings to return the host address. Avoid it, if possible. You could also delay converting the time until a client needs it, and the current representation is known to be stale. So if the places that a set of Strings differ in don't get sampled you can see lots of similar hash values.