Skip to content

Commit

Permalink
Make UseFutureHandle Clone (#3529)
Browse files Browse the repository at this point in the history
* Make UseFutureHandle Clone

* Make UseFutureHandle Clone
  • Loading branch information
AdamSteinberg1 authored Oct 12, 2024
1 parent e99492e commit 197e2d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/yew/src/suspense/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ pub struct UseFutureHandle<O> {
inner: UseStateHandle<Option<O>>,
}

impl<O> Clone for UseFutureHandle<O> {
fn clone(&self) -> Self {
Self {
inner: self.inner.clone(),
}
}
}

impl<O> Deref for UseFutureHandle<O> {
type Target = O;

Expand Down

1 comment on commit 197e2d5

@github-actions
Copy link

Choose a reason for hiding this comment

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

Yew master branch benchmarks (Lower is better)

Benchmark suite Current: 197e2d5 Previous: e99492e Ratio
yew-hooks-v0.21.0-keyed 01_run1k 200.6 193.4 1.04
yew-hooks-v0.21.0-keyed 02_replace1k 232.4 220.1 1.06
yew-hooks-v0.21.0-keyed 03_update10th1k_x16 101 91.2 1.11
yew-hooks-v0.21.0-keyed 04_select1k 43 43.1 1.00
yew-hooks-v0.21.0-keyed 05_swap1k 112.3 104.7 1.07
yew-hooks-v0.21.0-keyed 06_remove-one-1k 85.6 80.2 1.07
yew-hooks-v0.21.0-keyed 07_create10k 2276.6 2210.4 1.03
yew-hooks-v0.21.0-keyed 08_create1k-after1k_x2 230.8 221 1.04
yew-hooks-v0.21.0-keyed 09_clear1k_x8 90.8 88.5 1.03
yew-hooks-v0.21.0-keyed 21_ready-memory 2.1483068466186523 2.1485586166381836 1.00
yew-hooks-v0.21.0-keyed 22_run-memory 6.259356498718262 6.259779930114746 1.00
yew-hooks-v0.21.0-keyed 23_update5-memory 6.62249755859375 6.622470855712891 1.00
yew-hooks-v0.21.0-keyed 25_run-clear-memory 5.147143363952637 5.152824401855469 1.00
yew-hooks-v0.21.0-keyed 26_run-10k-memory 42.795040130615234 42.79540252685547 1.00
yew-hooks-v0.21.0-keyed 41_size-uncompressed 168 168 1
yew-hooks-v0.21.0-keyed 42_size-compressed 54.6 54.6 1
yew-hooks-v0.21.0-keyed 43_first-paint 455.9 460.1 0.99
yew-v0.21.0-keyed 01_run1k 196 193.6 1.01
yew-v0.21.0-keyed 02_replace1k 222.7 221.5 1.01
yew-v0.21.0-keyed 03_update10th1k_x16 72.4 71.6 1.01
yew-v0.21.0-keyed 04_select1k 17.8 16 1.11
yew-v0.21.0-keyed 05_swap1k 83.7 79.2 1.06
yew-v0.21.0-keyed 06_remove-one-1k 73.6 71.4 1.03
yew-v0.21.0-keyed 07_create10k 2247.7 2233.8 1.01
yew-v0.21.0-keyed 08_create1k-after1k_x2 223.9 219.2 1.02
yew-v0.21.0-keyed 09_clear1k_x8 91 89.8 1.01
yew-v0.21.0-keyed 21_ready-memory 2.133543014526367 2.151097297668457 0.99
yew-v0.21.0-keyed 22_run-memory 6.247433662414551 6.214310646057129 1.01
yew-v0.21.0-keyed 23_update5-memory 6.338129043579102 6.371641159057617 0.99
yew-v0.21.0-keyed 25_run-clear-memory 4.954008102416992 4.972882270812988 1.00
yew-v0.21.0-keyed 26_run-10k-memory 41.54412651062012 41.57719898223877 1.00
yew-v0.21.0-keyed 41_size-uncompressed 166 166 1
yew-v0.21.0-keyed 42_size-compressed 54.4 54.4 1
yew-v0.21.0-keyed 43_first-paint 427.5 430.9 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.