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

Use Ref::filter_map if rustc is later than 1.63 #2904

Merged
merged 1 commit into from Oct 19, 2022

Conversation

futursolo
Copy link
Member

Description

Use Ref::filter_map Instead of test and unwrapping if compiler is later than 1.63.

Checklist

  • I have reviewed my own code
  • I have added tests

@futursolo futursolo added the A-yew Area: The main yew crate label Oct 2, 2022
@github-actions
Copy link

github-actions bot commented Oct 2, 2022

Visit the preview URL for this PR (updated for commit 3d95e7c):

https://yew-rs-api--pr2904-filter-map-since-1-6-0iru2mg8.web.app

(expires Sun, 09 Oct 2022 03:03:47 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Oct 2, 2022

Benchmark - SSR

Yew Master

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 269.437 281.657 271.109 3.763
Hello World 10 476.162 482.558 478.077 2.099
Function Router 10 1664.824 1700.117 1678.508 11.165
Concurrent Task 10 1005.482 1006.901 1006.421 0.491

Pull Request

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 280.937 286.511 281.828 1.668
Hello World 10 476.906 489.758 479.085 3.936
Function Router 10 1665.499 1693.691 1673.255 9.849
Concurrent Task 10 1006.334 1007.366 1006.792 0.288

@github-actions
Copy link

github-actions bot commented Oct 2, 2022

Size Comparison

examples master (KB) pull request (KB) diff (KB) diff (%)
boids 170.441 170.457 +0.016 +0.009%
communication_child_to_parent 90.600 90.613 +0.014 +0.015%
communication_grandchild_with_grandparent 105.538 105.558 +0.020 +0.019%
communication_grandparent_to_grandchild 101.438 101.449 +0.012 +0.012%
communication_parent_to_child 87.736 87.750 +0.014 +0.016%
contexts 107.961 107.972 +0.011 +0.010%
counter 85.610 85.624 +0.014 +0.016%
counter_functional 86.141 86.152 +0.012 +0.014%
dyn_create_destroy_apps 88.521 88.532 +0.012 +0.013%
file_upload 100.188 100.204 +0.016 +0.016%
function_memory_game 163.358 163.364 +0.006 +0.004%
function_router 348.186 348.221 +0.035 +0.010%
function_todomvc 158.178 158.183 +0.005 +0.003%
futures 222.486 222.500 +0.014 +0.006%
game_of_life 105.158 105.169 +0.011 +0.010%
immutable 181.867 181.884 +0.017 +0.009%
inner_html 82.478 82.490 +0.013 +0.015%
js_callback 111.602 111.608 +0.007 +0.006%
keyed_list 195.783 195.795 +0.012 +0.006%
mount_point 85.236 85.252 +0.016 +0.018%
nested_list 112.143 112.153 +0.011 +0.010%
node_refs 93.141 93.155 +0.015 +0.016%
password_strength 1548.475 1548.483 +0.009 +0.001%
portals 96.530 96.549 +0.019 +0.019%
router 317.885 317.916 +0.031 +0.010%
simple_ssr 152.458 152.469 +0.011 +0.007%
ssr_router 393.735 393.777 +0.042 +0.011%
suspense 109.337 109.343 +0.006 +0.005%
timer 88.435 88.446 +0.012 +0.013%
todomvc 139.268 139.279 +0.012 +0.008%
two_apps 86.224 86.235 +0.012 +0.014%
web_worker_fib 152.530 152.544 +0.014 +0.009%
webgl 84.917 84.932 +0.015 +0.017%

✅ None of the examples has changed their size significantly.

Copy link
Member

@WorldSEnder WorldSEnder left a comment

Choose a reason for hiding this comment

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

Including rustversion, at least on my machine, does not contribute to the critical path for compile time and has little overhead there. Fine by me to avoid an unwrap.

@futursolo futursolo merged commit 5f6e094 into yewstack:master Oct 19, 2022
@futursolo futursolo deleted the filter-map-since-1-63 branch December 15, 2022 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew Area: The main yew crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants