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

optimization: reduce heap allocation #970

Merged
merged 4 commits into from
Nov 22, 2023

Conversation

blasrodri
Copy link
Contributor

Prefer str::from_utf8 over String::from_utf8 to avoid
unnecesary heap allocation

Closes: #XXX

Description


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

Prefer str::from_utf8 over String::from_utf8 to avoid
unnecesary heap allocation
Copy link

codecov bot commented Nov 18, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (4421b0d) 70.24% compared to head (02bb26d) 70.24%.
Report is 1 commits behind head on main.

Files Patch % Lines
...cs04-channel/types/src/events/packet_attributes.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #970   +/-   ##
=======================================
  Coverage   70.24%   70.24%           
=======================================
  Files         177      177           
  Lines       17730    17730           
=======================================
  Hits        12455    12455           
  Misses       5275     5275           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Farhad-Shabani
Copy link
Member

Thanks a bunch for this PR @blasrodri. Just needs a unclog + cargo +nightly fmt, then we are good to go. 🙏

@Farhad-Shabani Farhad-Shabani added the O: optimization Objective: aims to optimize performance, allocations and computations label Nov 20, 2023
@Farhad-Shabani Farhad-Shabani added this to the v0.48.0 milestone Nov 20, 2023
@blasrodri blasrodri marked this pull request as ready for review November 20, 2023 18:51
Copy link
Member

@Farhad-Shabani Farhad-Shabani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@Farhad-Shabani Farhad-Shabani merged commit 71df7e8 into cosmos:main Nov 22, 2023
13 checks passed
Farhad-Shabani added a commit that referenced this pull request Sep 9, 2024
* optimization: reduce heap allocation

Prefer str::from_utf8 over String::from_utf8 to avoid
unnecesary heap allocation

* fmt

* chore: add unclog

---------

Co-authored-by: Farhad Shabani <farhad.shabani@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: optimization Objective: aims to optimize performance, allocations and computations
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants