Skip to content

Conversation

@cecton
Copy link
Contributor

@cecton cecton commented Nov 1, 2023

Description

What does this PR do?

  1. Use more cheap-to-clone types in the examples
  2. Some examples got impacted by remove ToHtml trait #3453 (the removal of ToHtml), I fixed them so we can use reference where it makes sense (I added a few IntoPropValue on cheap-to-clone types)
  3. Updated implicit-clone to the latest version
  4. Optimized ChildrenRenderer memory allocations by using Rc

Changes did on the side:

  1. In order to get some example working, I had to change NodeSeq to use IArray. This is good because it is more optimized for memory allocations too
  2. Slightly improve the API of VChild to easily get a ref mut inside its properties object (just for convenience!)

Related to #3453

Checklist

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

github-actions[bot]
github-actions bot previously approved these changes Nov 1, 2023
@github-actions
Copy link

github-actions bot commented Nov 1, 2023

Benchmark - core

Yew Master

vnode           fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ vnode_clone  2.484 ns      │ 2.524 ns      │ 2.486 ns      │ 2.489 ns      │ 100     │ 1000000000

Pull Request

vnode           fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ vnode_clone  2.462 ns      │ 3.806 ns      │ 2.468 ns      │ 2.734 ns      │ 100     │ 1000000000

@github-actions
Copy link

github-actions bot commented Nov 1, 2023

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

https://yew-rs--pr3508-cleanup-implicit-clo-47fnh718.web.app

(expires Wed, 03 Sep 2025 06:12:57 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Nov 1, 2023

Benchmark - SSR

Yew Master

Details
Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 310.529 310.827 310.684 0.103
Hello World 10 461.976 470.843 464.421 2.425
Function Router 10 1570.575 1595.179 1579.356 7.625
Concurrent Task 10 1005.577 1007.042 1006.354 0.452
Many Providers 10 1089.051 1120.011 1102.850 10.308

Pull Request

Details
Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 310.398 315.395 311.092 1.518
Hello World 10 462.294 479.943 471.559 6.804
Function Router 10 1645.157 1675.293 1659.963 10.935
Concurrent Task 10 1005.018 1007.482 1006.512 0.649
Many Providers 10 1063.287 1100.758 1076.272 11.430

@github-actions
Copy link

github-actions bot commented Nov 1, 2023

Size Comparison

Details
examples master (KB) pull request (KB) diff (KB) diff (%)
async_clock 99.393 99.395 +0.002 +0.002%
boids 168.234 168.777 +0.543 +0.323%
communication_child_to_parent 91.684 91.750 +0.066 +0.072%
communication_grandchild_with_grandparent 102.698 102.776 +0.078 +0.076%
communication_grandparent_to_grandchild 97.713 97.771 +0.059 +0.060%
communication_parent_to_child 87.610 87.662 +0.052 +0.059%
contexts 103.828 103.847 +0.019 +0.018%
counter 84.416 85.170 +0.754 +0.893%
counter_functional 84.772 85.347 +0.574 +0.677%
dyn_create_destroy_apps 87.413 87.946 +0.533 +0.610%
file_upload 98.499 98.696 +0.197 +0.200%
function_delayed_input 91.803 91.805 +0.002 +0.002%
function_memory_game 170.152 170.798 +0.646 +0.379%
function_router 337.268 338.003 +0.735 +0.218%
function_todomvc 162.579 163.375 +0.796 +0.490%
futures 238.500 238.503 +0.003 +0.001%
game_of_life 104.475 104.536 +0.062 +0.059%
immutable 193.762 194.714 +0.952 +0.491%
inner_html 80.062 80.062 0 0.000%
js_callback 107.534 108.309 +0.774 +0.720%
keyed_list 195.801 196.530 +0.729 +0.373%
mount_point 83.428 83.430 +0.002 +0.002%
nested_list 112.514 115.165 +2.651 +2.356%
node_refs 90.797 90.862 +0.065 +0.072%
password_strength 1777.343 1777.411 +0.068 +0.004%
portals 92.571 93.322 +0.751 +0.811%
router 306.775 307.474 +0.698 +0.228%
suspense 111.543 112.323 +0.780 +0.700%
timer 88.673 88.777 +0.104 +0.118%
timer_functional 94.701 95.176 +0.475 +0.501%
todomvc 142.847 143.733 +0.887 +0.621%
two_apps 85.788 85.790 +0.002 +0.002%
web_worker_fib 134.242 134.886 +0.644 +0.479%
web_worker_prime 187.418 187.522 +0.104 +0.056%
webgl 83.027 83.027 0 0.000%

⚠️ The following example has changed its size significantly:

examples master (KB) pull request (KB) diff (KB) diff (%)
nested_list 112.514 115.165 +2.651 +2.356%

github-actions[bot]
github-actions bot previously approved these changes Nov 1, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 1, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 6, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 6, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 6, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 6, 2023
@cecton
Copy link
Contributor Author

cecton commented Nov 6, 2023

@kirillsemyonkin now I think the benchmark results look good. Not a big improvement but not a lost either except maybe on the "baseline" but that's probably normal.

github-actions[bot]
github-actions bot previously approved these changes Nov 11, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 11, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 19, 2023
@Madoshakalaka Madoshakalaka force-pushed the cleanup-implicit-clone-related-stuff branch 3 times, most recently from 46c924f to 224e08b Compare August 27, 2025 02:31
# Conflicts:
#	Cargo.lock
#	packages/yew-macro/Cargo.toml
#	packages/yew-macro/tests/classes_macro/classes-fail.stderr
#	packages/yew-macro/tests/html_macro/element-fail.stderr
#	packages/yew/Cargo.toml
#	packages/yew/src/virtual_dom/key.rs
#	packages/yew/src/virtual_dom/vlist.rs
@Madoshakalaka Madoshakalaka force-pushed the cleanup-implicit-clone-related-stuff branch from 7bd6cd2 to 1760153 Compare August 27, 2025 05:37
@Madoshakalaka Madoshakalaka force-pushed the cleanup-implicit-clone-related-stuff branch from 1760153 to c3accc5 Compare August 27, 2025 06:07
@Madoshakalaka Madoshakalaka merged commit b007219 into yewstack:master Aug 27, 2025
26 checks passed
@cecton cecton deleted the cleanup-implicit-clone-related-stuff branch August 27, 2025 09:41
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.

3 participants