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

Client identifier sorting optimization #1024

Closed
5 tasks done
adizere opened this issue Jun 1, 2021 · 0 comments · Fixed by #1432
Closed
5 tasks done

Client identifier sorting optimization #1024

adizere opened this issue Jun 1, 2021 · 0 comments · Fixed by #1432
Assignees
Labels
A: good-first-issue Admin: good for newcomers O: new-feature Objective: cause to add a new feature or support
Milestone

Comments

@adizere
Copy link
Member

adizere commented Jun 1, 2021

Crate

ibc-relayer mostly

Summary

Two nitpicks:

a) We should probably use sort_by_cached_key here to avoid recomputing the suffix on every comparison
b) This could be rewritten in a slightly simpler way using sort_by_{cached_}key:

clients.sort_by_cached_key(|c| client_id_suffix(&c.client_id).unwrap_or(0))

Original comment


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@adizere adizere added O: new-feature Objective: cause to add a new feature or support A: good-first-issue Admin: good for newcomers labels Jun 1, 2021
@adizere adizere added this to the 07.2021 milestone Jun 1, 2021
@adizere adizere self-assigned this Jun 1, 2021
@adizere adizere modified the milestones: 07.2021, 09.2021 Jun 26, 2021
@adizere adizere modified the milestones: 09.2021, Backlog Sep 6, 2021
blewater added a commit to blewater/ibc-rs that referenced this issue Oct 6, 2021
blewater added a commit to blewater/ibc-rs that referenced this issue Oct 6, 2021
blewater added a commit to blewater/ibc-rs that referenced this issue Oct 7, 2021
romac added a commit that referenced this issue Oct 7, 2021
…g `client_id_suffix()` repeatedly (#1432)

* #1024 Optimize clients sorting by client_id_suffix

* #1024 Unit test

* Formatting

Co-authored-by: Romain Ruetschi <[email protected]>
@adizere adizere modified the milestones: Backlog, 10.2021 Oct 28, 2021
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this issue Sep 13, 2022
…g `client_id_suffix()` repeatedly (informalsystems#1432)

* informalsystems#1024 Optimize clients sorting by client_id_suffix

* informalsystems#1024 Unit test

* Formatting

Co-authored-by: Romain Ruetschi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: good-first-issue Admin: good for newcomers O: new-feature Objective: cause to add a new feature or support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants