-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
core: don't allocate in DedupAddrs #2395
Conversation
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.
This is awesome! 🙇
da24677
to
c219ccd
Compare
var addrs []ma.Multiaddr | ||
r := rand.New(rand.NewSource(1234)) | ||
for i := 0; i < 100; i++ { | ||
tcpAddr := ma.StringCast(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", r.Intn(math.MaxUint16))) |
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.
@sukunrt I tweaked your benchmark function a bit, to make sure the addresses aren't already ordered.
Benchmarking result (compared to what we have in master):
|
Closes #2352.