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

perf(layout): avoid allocating memory when using split ergonomic utils #1105

Merged
merged 1 commit into from
May 13, 2024

Conversation

tranzystorekk
Copy link
Contributor

Noticed we create an intermediate vec in Layout::areas and Layout::spacers but there's no need for one.

Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 94.2%. Comparing base (eb281df) to head (2fa664a).

Files Patch % Lines
src/layout/layout.rs 50.0% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1105   +/-   ##
=====================================
  Coverage   94.2%   94.2%           
=====================================
  Files         61      61           
  Lines      14587   14587           
=====================================
  Hits       13751   13751           
  Misses       836     836           

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

Copy link
Member

@EdJoPaTo EdJoPaTo left a comment

Choose a reason for hiding this comment

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

I like seeing improvements approaches like this!

src/layout/layout.rs Show resolved Hide resolved
@joshka joshka merged commit 1a4bb1c into ratatui-org:main May 13, 2024
32 of 33 checks passed
@tranzystorekk tranzystorekk deleted the areas-no-vec branch May 13, 2024 23:56
joshka pushed a commit to nowNick/ratatui that referenced this pull request May 24, 2024
ratatui-org#1105)

Don't create intermediate vec in `Layout::areas` and
`Layout::spacers` when there's no need for one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants