-
Notifications
You must be signed in to change notification settings - Fork 225
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
perf(fastrand): optimize Read #123
Conversation
name old time/op new time/op delta SingleCore/math/rand-Uint32()-16 10.8ns ± 0% 10.8ns ± 0% ~ (p=0.913 n=7+10) SingleCore/fast-rand-Uint32()-16 2.26ns ± 0% 2.25ns ± 0% ~ (p=0.015 n=10+10) SingleCore/math/rand-Uint64()-16 11.1ns ± 0% 11.1ns ± 0% ~ (p=0.014 n=10+8) SingleCore/fast-rand-Uint64()-16 5.03ns ± 0% 4.75ns ± 0% -5.50% (p=0.000 n=10+9) SingleCore/math/rand-Read1000-16 682ns ± 0% 682ns ± 0% ~ (p=0.927 n=10+10) SingleCore/fast-rand-Read1000-16 298ns ± 1% 150ns ± 0% -49.69% (p=0.000 n=10+9) MultipleCore/math/rand-Uint32()-16 114ns ± 3% 113ns ± 4% ~ (p=0.306 n=10+10) MultipleCore/fast-rand-Uint32()-16 0.18ns ± 1% 0.18ns ± 2% ~ (p=0.006 n=9+10) MultipleCore/math/rand-Uint64()-16 115ns ± 6% 118ns ± 3% ~ (p=0.018 n=10+9) MultipleCore/fast-rand-Uint64()-16 0.39ns ± 1% 0.38ns ± 0% -1.55% (p=0.000 n=10+8) MultipleCore/math/rand-Read1000-16 1.02µs ± 3% 1.03µs ± 4% ~ (p=0.644 n=10+10) MultipleCore/fast-rand-Read1000-16 112ns ± 0% 102ns ± 1% -9.38% (p=0.000 n=10+10)
BenchdiffRuns: Benchdiff #33 Job is started. |
BenchdiffCommand: Resultspkg: github.com/bytedance/gopkg/lang/fastrand
|
要不 ci 顺便修一下?看起来加个 -y 就行了? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
use wyrand, see https://github.com/wangyi-fudan/wyhash. name old time/op new time/op delta SingleCore/math/rand-Uint32()-16 10.8ns ± 0% 10.8ns ± 0% ~ (p=0.913 n=7+10) SingleCore/fast-rand-Uint32()-16 2.26ns ± 0% 2.25ns ± 0% ~ (p=0.015 n=10+10) SingleCore/math/rand-Uint64()-16 11.1ns ± 0% 11.1ns ± 0% ~ (p=0.014 n=10+8) SingleCore/fast-rand-Uint64()-16 5.03ns ± 0% 4.75ns ± 0% -5.50% (p=0.000 n=10+9) SingleCore/math/rand-Read1000-16 682ns ± 0% 682ns ± 0% ~ (p=0.927 n=10+10) SingleCore/fast-rand-Read1000-16 298ns ± 1% 150ns ± 0% -49.69% (p=0.000 n=10+9) MultipleCore/math/rand-Uint32()-16 114ns ± 3% 113ns ± 4% ~ (p=0.306 n=10+10) MultipleCore/fast-rand-Uint32()-16 0.18ns ± 1% 0.18ns ± 2% ~ (p=0.006 n=9+10) MultipleCore/math/rand-Uint64()-16 115ns ± 6% 118ns ± 3% ~ (p=0.018 n=10+9) MultipleCore/fast-rand-Uint64()-16 0.39ns ± 1% 0.38ns ± 0% -1.55% (p=0.000 n=10+8) MultipleCore/math/rand-Read1000-16 1.02µs ± 3% 1.03µs ± 4% ~ (p=0.644 n=10+10) MultipleCore/fast-rand-Read1000-16 112ns ± 0% 102ns ± 1% -9.38% (p=0.000 n=10+10)
Use wyrand, see https://github.com/wangyi-fudan/wyhash.