Skip to content

Upgrate bincode from 1.x to 2.0.0-rc.3#3899

Merged
Madoshakalaka merged 2 commits intomasterfrom
upgrade-bincode-2
Aug 21, 2025
Merged

Upgrate bincode from 1.x to 2.0.0-rc.3#3899
Madoshakalaka merged 2 commits intomasterfrom
upgrade-bincode-2

Conversation

@Madoshakalaka
Copy link
Member

Bincode 2 has big breaking changes, tried to use 2.0.1 but realized its MSRV is 1.85.0 and settled for 2.0.0-rc.3

I refered to bincode's migration guide

Migrated API calls:

Replaced bincode::serialize with bincode::serde::encode_to_vec using bincode::config::standard()
Replaced bincode::deserialize with bincode::serde::decode_from_slice using bincode::config::standard()

@github-actions
Copy link

github-actions bot commented Aug 14, 2025

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

https://yew-rs-api--pr3899-upgrade-bincode-2-u86c5gt9.web.app

(expires Thu, 28 Aug 2025 05:03:24 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Aug 14, 2025

Benchmark - core

Yew Master

vnode           fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ vnode_clone  2.31 ns       │ 2.337 ns      │ 2.314 ns      │ 2.316 ns      │ 100     │ 1000000000

Pull Request

vnode           fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ vnode_clone  3.675 ns      │ 3.863 ns      │ 3.68 ns       │ 3.686 ns      │ 100     │ 1000000000

@github-actions
Copy link

github-actions bot commented Aug 14, 2025

Benchmark - SSR

Yew Master

Details
Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 291.021 291.587 291.163 0.184
Hello World 10 492.068 501.252 497.492 2.938
Function Router 10 1635.443 1661.168 1650.483 9.250
Concurrent Task 10 1005.695 1006.801 1006.469 0.344
Many Providers 10 1110.961 1158.990 1132.655 16.305

Pull Request

Details
Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 310.445 311.364 310.652 0.268
Hello World 10 491.902 513.975 498.800 6.343
Function Router 10 1559.465 1593.218 1571.867 9.281
Concurrent Task 10 1005.662 1007.232 1006.504 0.509
Many Providers 10 1083.595 1119.233 1100.234 11.615

@github-actions
Copy link

github-actions bot commented Aug 14, 2025

Size Comparison

Details
examples master (KB) pull request (KB) diff (KB) diff (%)
async_clock 99.188 99.195 +0.007 +0.007%
boids 167.999 168.005 +0.006 +0.003%
communication_child_to_parent 91.551 91.554 +0.003 +0.003%
communication_grandchild_with_grandparent 102.578 102.578 0 0.000%
communication_grandparent_to_grandchild 97.574 97.573 -0.001 -0.001%
communication_parent_to_child 87.469 87.470 +0.001 +0.001%
contexts 103.683 103.688 +0.006 +0.006%
counter 84.274 84.274 0 0.000%
counter_functional 84.623 84.623 0 0.000%
dyn_create_destroy_apps 87.301 87.274 -0.026 -0.030%
file_upload 98.170 98.170 0 0.000%
function_memory_game 170.058 170.059 +0.001 +0.001%
function_router 337.326 336.237 -1.089 -0.323%
function_todomvc 162.446 162.450 +0.004 +0.002%
futures 236.567 236.567 0 0.000%
game_of_life 104.527 104.512 -0.016 -0.015%
immutable 193.298 193.274 -0.023 -0.012%
inner_html 79.920 79.920 0 0.000%
js_callback 107.405 107.411 +0.006 +0.005%
keyed_list 195.415 195.425 +0.010 +0.005%
mount_point 83.286 83.287 +0.001 +0.001%
nested_list 112.411 112.415 +0.004 +0.003%
node_refs 90.651 90.649 -0.002 -0.002%
password_strength 1782.876 1782.874 -0.002 -0.000%
portals 92.436 92.442 +0.007 +0.007%
router 306.712 305.597 -1.115 -0.364%
suspense 111.410 111.410 0 0.000%
timer 88.550 88.542 -0.008 -0.009%
timer_functional 94.586 94.578 -0.008 -0.008%
todomvc 142.697 142.697 0 0.000%
two_apps 85.640 85.640 0 0.000%
web_worker_fib 134.121 134.115 -0.006 -0.004%
web_worker_prime 184.411 187.353 +2.941 +1.595%
webgl 82.888 82.856 -0.031 -0.038%

⚠️ The following example has changed its size significantly:

examples master (KB) pull request (KB) diff (KB) diff (%)
web_worker_prime 184.411 187.353 +2.941 +1.595%

- Updated bincode dependency to 2.0.0-rc.3 in yew and yew-agent packages
- Migrated from bincode::serialize/deserialize to bincode::serde::encode_to_vec/decode_from_slice
- Updated test expectations for changed base64 encoding format
- Used 2.0.0-rc.3 to maintain MSRV compatibility with Rust 1.78.0
@Madoshakalaka Madoshakalaka marked this pull request as ready for review August 14, 2025 17:40
github-actions[bot]
github-actions bot previously approved these changes Aug 14, 2025
github-actions[bot]
github-actions bot previously approved these changes Aug 20, 2025
github-actions[bot]
github-actions bot previously approved these changes Aug 20, 2025
github-actions[bot]
github-actions bot previously approved these changes Aug 20, 2025
github-actions[bot]
github-actions bot previously approved these changes Aug 20, 2025
github-actions[bot]
github-actions bot previously approved these changes Aug 20, 2025
github-actions[bot]
github-actions bot previously approved these changes Aug 20, 2025
github-actions[bot]
github-actions bot previously approved these changes Aug 20, 2025
github-actions[bot]
github-actions bot previously approved these changes Aug 20, 2025
@Madoshakalaka
Copy link
Member Author

Madoshakalaka commented Aug 21, 2025

force push mess was when I tried to fix the CI only ended up realizing it was a rustc nightly issue that only lasted for one day

@Madoshakalaka Madoshakalaka merged commit 50f987d into master Aug 21, 2025
47 of 49 checks passed
@WorldSEnder WorldSEnder deleted the upgrade-bincode-2 branch October 22, 2025 11:47
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