Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bytes: degradations in compareBytes benchmarks between 1.7 and 1.8 #18986

Closed
laboger opened this issue Feb 7, 2017 · 2 comments
Closed

bytes: degradations in compareBytes benchmarks between 1.7 and 1.8 #18986

laboger opened this issue Feb 7, 2017 · 2 comments

Comments

@laboger
Copy link
Contributor

laboger commented Feb 7, 2017

There are two benchmarks in the bytes test for IndexByte that degraded between 1.7 and 1.8 and possibly should be investigated.

BenchmarkCompareBytesIdentical-16 6.91 11.4 +64.98%
BenchmarkCompareBytesToNil-16 7.40 11.1 +50.00%

And this one! I think it is crossing a page boundary or something.
BenchmarkCompareBytesBigIdentical-16 6.62 46511 +702483.08%

@laboger laboger closed this as completed Feb 7, 2017
@bradfitz
Copy link
Contributor

bradfitz commented Feb 7, 2017

Did you mean to close this? Which OS/arch?

@mundaym
Copy link
Member

mundaym commented Feb 8, 2017

Not sure about the others but the BenchmarkCompareBytesBigIdentical numbers indicate that the bytes.Compare function is missing a check for matching pointers. In other words it is probably missing a special case for this situation:

a := [65536]byte{}
bytes.Compare(a[:], a[:])

@golang golang locked and limited conversation to collaborators Feb 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants