Skip to content

Conversation

@jesper-olsen
Copy link
Contributor

Description

  1. Performance Optimization: Removed redundant Vec clones in Action::FlipCard. By moving the local cards variable into the new state, we avoid unnecessary allocations.
  2. UX Improvement: Updated Action::TrySaveBestScore to return a new state with the updated best_score. Previously, the UI would only reflect a new high score after a game reset, as the reducer only performed a side effect on LocalStorage without updating the in-memory state.

Fixes #0000

Checklist

  • [ x] I have reviewed my own code
  • I have verified the changes in a browser
  • I have added tests

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Size Comparison

Details
examples master (KB) pull request (KB) diff (KB) diff (%)
async_clock 98.204 98.204 0 0.000%
boids 167.717 167.717 0 0.000%
communication_child_to_parent 91.335 91.335 0 0.000%
communication_grandchild_with_grandparent 102.442 102.442 0 0.000%
communication_grandparent_to_grandchild 98.820 98.820 0 0.000%
communication_parent_to_child 88.695 88.695 0 0.000%
contexts 103.983 103.983 0 0.000%
counter 85.364 85.364 0 0.000%
counter_functional 85.729 85.729 0 0.000%
dyn_create_destroy_apps 88.534 88.534 0 0.000%
file_upload 97.963 97.963 0 0.000%
function_delayed_input 91.248 91.248 0 0.000%
function_memory_game 169.794 169.877 +0.083 +0.049%
function_router 328.655 328.655 0 0.000%
function_todomvc 161.375 161.375 0 0.000%
futures 234.317 234.317 0 0.000%
game_of_life 103.759 103.759 0 0.000%
immutable 245.760 245.760 0 0.000%
inner_html 79.848 79.848 0 0.000%
js_callback 107.756 107.756 0 0.000%
keyed_list 179.063 179.063 0 0.000%
mount_point 83.066 83.066 0 0.000%
nested_list 112.634 112.634 0 0.000%
node_refs 90.708 90.708 0 0.000%
password_strength 1738.812 1738.812 0 0.000%
portals 92.202 92.202 0 0.000%
router 301.765 301.765 0 0.000%
suspense 111.703 111.703 0 0.000%
timer 87.992 87.992 0 0.000%
timer_functional 96.036 96.036 0 0.000%
todomvc 141.359 141.359 0 0.000%
two_apps 85.228 85.228 0 0.000%
web_worker_fib 133.346 133.346 0 0.000%
web_worker_prime 184.949 184.949 0 0.000%
webgl 82.484 82.484 0 0.000%

✅ None of the examples has changed their size significantly.

Copy link
Member

@Madoshakalaka Madoshakalaka left a comment

Choose a reason for hiding this comment

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

Good improvements, thanks

@Madoshakalaka Madoshakalaka added the A-examples Area: The examples label Jan 8, 2026
@Madoshakalaka Madoshakalaka merged commit a5aefd8 into yewstack:master Jan 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-examples Area: The examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants