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: remove various small allocations #1407

Closed
wants to merge 4 commits into from

Conversation

airblast-dev
Copy link
Contributor

Just a few minor allocation optimizations.

One thing to note is in 0a8d59d we can create a wrapper function with a generic and use that to remove an allocation in the case that a width is not provided by using std::iter::repeat(val).take(col_count). Though in practice it worsened performance due to (I assume) branching.

To state the obvious, the changes here don't actually affect any of the benchmarks results, but are just small free optimizations.

@airblast-dev airblast-dev requested a review from a team as a code owner October 7, 2024 10:13
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.5%. Comparing base (1153a9e) to head (d607fc9).
Report is 8 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1407    /-   ##
=====================================
  Coverage   93.5%   93.5%           
=====================================
  Files         68      68           
  Lines      15970   15976     6     
=====================================
  Hits       14944   14950     6     
  Misses      1026    1026           

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

Copy link

github-actions bot commented Oct 7, 2024

🐰 Bencher Report

Branch1407/merge
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
barchart/render/2048📈 view plot
⚠️ NO THRESHOLD
211,460.00
barchart/render/256📈 view plot
⚠️ NO THRESHOLD
148,390.00
barchart/render/64📈 view plot
⚠️ NO THRESHOLD
94,107.00
barchart/render_grouped/2048📈 view plot
⚠️ NO THRESHOLD
359,670.00
barchart/render_grouped/256📈 view plot
⚠️ NO THRESHOLD
154,520.00
barchart/render_grouped/64📈 view plot
⚠️ NO THRESHOLD
144,140.00
barchart/render_horizontal/2048📈 view plot
⚠️ NO THRESHOLD
166,070.00
barchart/render_horizontal/256📈 view plot
⚠️ NO THRESHOLD
83,315.00
barchart/render_horizontal/64📈 view plot
⚠️ NO THRESHOLD
76,904.00
block/render_all_feature/100x50📈 view plot
⚠️ NO THRESHOLD
10,879.00
block/render_all_feature/200x50📈 view plot
⚠️ NO THRESHOLD
18,860.00
block/render_all_feature/256x256📈 view plot
⚠️ NO THRESHOLD
86,501.00
block/render_empty/100x50📈 view plot
⚠️ NO THRESHOLD
5,792.10
block/render_empty/200x50📈 view plot
⚠️ NO THRESHOLD
11,187.00
block/render_empty/256x256📈 view plot
⚠️ NO THRESHOLD
72,355.00
buffer/empty/16📈 view plot
⚠️ NO THRESHOLD
823.75
buffer/empty/255📈 view plot
⚠️ NO THRESHOLD
225,950.00
buffer/empty/64📈 view plot
⚠️ NO THRESHOLD
13,714.00
buffer/filled/16📈 view plot
⚠️ NO THRESHOLD
793.92
buffer/filled/255📈 view plot
⚠️ NO THRESHOLD
225,100.00
buffer/filled/64📈 view plot
⚠️ NO THRESHOLD
13,189.00
buffer/with_lines/16📈 view plot
⚠️ NO THRESHOLD
15,329.00
buffer/with_lines/255📈 view plot
⚠️ NO THRESHOLD
15,365.00
buffer/with_lines/64📈 view plot
⚠️ NO THRESHOLD
14,784.00
line_render/Center/0📈 view plot
⚠️ NO THRESHOLD
4.04
line_render/Center/10📈 view plot
⚠️ NO THRESHOLD
643.54
line_render/Center/3📈 view plot
⚠️ NO THRESHOLD
311.96
line_render/Center/4📈 view plot
⚠️ NO THRESHOLD
351.74
line_render/Center/42📈 view plot
⚠️ NO THRESHOLD
845.74
line_render/Center/6📈 view plot
⚠️ NO THRESHOLD
402.46
line_render/Center/7📈 view plot
⚠️ NO THRESHOLD
457.79
line_render/Left/0📈 view plot
⚠️ NO THRESHOLD
4.05
line_render/Left/10📈 view plot
⚠️ NO THRESHOLD
597.01
line_render/Left/3📈 view plot
⚠️ NO THRESHOLD
228.66
line_render/Left/4📈 view plot
⚠️ NO THRESHOLD
242.51
line_render/Left/42📈 view plot
⚠️ NO THRESHOLD
844.69
line_render/Left/6📈 view plot
⚠️ NO THRESHOLD
387.47
line_render/Left/7📈 view plot
⚠️ NO THRESHOLD
402.27
line_render/Right/0📈 view plot
⚠️ NO THRESHOLD
4.04
line_render/Right/10📈 view plot
⚠️ NO THRESHOLD
575.28
line_render/Right/3📈 view plot
⚠️ NO THRESHOLD
286.02
line_render/Right/4📈 view plot
⚠️ NO THRESHOLD
361.65
line_render/Right/42📈 view plot
⚠️ NO THRESHOLD
845.30
line_render/Right/6📈 view plot
⚠️ NO THRESHOLD
461.41
line_render/Right/7📈 view plot
⚠️ NO THRESHOLD
530.68
list/render/16384📈 view plot
⚠️ NO THRESHOLD
1,226,500.00
list/render/2048📈 view plot
⚠️ NO THRESHOLD
334,560.00
list/render/64📈 view plot
⚠️ NO THRESHOLD
213,650.00
list/render_scroll_half/16384📈 view plot
⚠️ NO THRESHOLD
1,228,900.00
list/render_scroll_half/2048📈 view plot
⚠️ NO THRESHOLD
336,150.00
list/render_scroll_half/64📈 view plot
⚠️ NO THRESHOLD
141,990.00
paragraph/new/2048📈 view plot
⚠️ NO THRESHOLD
253,410.00
paragraph/new/64📈 view plot
⚠️ NO THRESHOLD
6,788.90
paragraph/new/65535📈 view plot
⚠️ NO THRESHOLD
8,159,400.00
paragraph/render/2048📈 view plot
⚠️ NO THRESHOLD
617,680.00
paragraph/render/64📈 view plot
⚠️ NO THRESHOLD
576,680.00
paragraph/render/65535📈 view plot
⚠️ NO THRESHOLD
1,815,800.00
paragraph/render_scroll_full/2048📈 view plot
⚠️ NO THRESHOLD
593,650.00
paragraph/render_scroll_full/64📈 view plot
⚠️ NO THRESHOLD
620,850.00
paragraph/render_scroll_full/65535📈 view plot
⚠️ NO THRESHOLD
1,783,000.00
paragraph/render_scroll_half/2048📈 view plot
⚠️ NO THRESHOLD
592,580.00
paragraph/render_scroll_half/64📈 view plot
⚠️ NO THRESHOLD
623,130.00
paragraph/render_scroll_half/65535📈 view plot
⚠️ NO THRESHOLD
1,785,600.00
paragraph/render_wrap/2048📈 view plot
⚠️ NO THRESHOLD
291,810.00
paragraph/render_wrap/64📈 view plot
⚠️ NO THRESHOLD
254,880.00
paragraph/render_wrap/65535📈 view plot
⚠️ NO THRESHOLD
1,494,400.00
paragraph/render_wrap_scroll_full/2048📈 view plot
⚠️ NO THRESHOLD
290,020.00
paragraph/render_wrap_scroll_full/64📈 view plot
⚠️ NO THRESHOLD
255,340.00
paragraph/render_wrap_scroll_full/65535📈 view plot
⚠️ NO THRESHOLD
1,504,200.00
rect_rows/rows/1024📈 view plot
⚠️ NO THRESHOLD
326.83
rect_rows/rows/16📈 view plot
⚠️ NO THRESHOLD
5.26
rect_rows/rows/65535📈 view plot
⚠️ NO THRESHOLD
20,395.00
sparkline/render/2048📈 view plot
⚠️ NO THRESHOLD
119,830.00
sparkline/render/256📈 view plot
⚠️ NO THRESHOLD
119,730.00
sparkline/render/64📈 view plot
⚠️ NO THRESHOLD
38,368.00
🐰 View full continuous benchmarking report in Bencher

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.

1 participant