For my benchmark I created 1024 strings and compared the first generated
string to the other 1023 strings. My comparison function is the first
16 byte strings, random content: 17236 ns/op vs 36277 ns/op
16 byte strings, equal content: 63365 ns/op vs 73647 ns/op
0 - 32 byte strings, random content: 17454 ns/op vs 26220 ns/op
0 - 32 byte strings, equal content: 16900 ns/op vs 23426 ns/op
Most of the strings I'm comparing are very close in length but have
different content. It looks like for my use case, a custom comparison
function is better than the builtin operators.
On Thu, Nov 29, 2012 at 2:21 PM, Kevin Gillette
Eh, when I said LeadingPrefix, I meant 'SharedPrefix'.