3 ms·
Single core version: find := "07123E1F482356C415F684407A3B8723E10B2CBBC0B8FCD6282C49D37C9C1ABC" That's definitely a string. Otherwise (single core) golang
by vardump 9y ago
Single core version:
find := "07123E1F482356C415F684407A3B8723E10B2CBBC0B8FCD6282C49D37C9C1ABC"
That's definitely a string.
Otherwise (single core) golang code seems to be just a test whether the compiler is smart enough to remove branch in this code:
if (b[n]) == (find[found]) {
found += 1
} else {
found = 0
}
I wouldn't be too surprised if golang compiler generates superfluous range checks costing even more performance. At least golang 1.4 seemed to generate a lot of unnecessary checks in code I optimized a few years ago. Hopefully newer versions are better.
- pbourke 9y agoyep, my mistake - was looking at multicore