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

Ideas for (internal) improvements #385

Open
45 tasks
MartinKavik opened this issue Mar 9, 2020 · 13 comments
Open
45 tasks

Ideas for (internal) improvements #385

MartinKavik opened this issue Mar 9, 2020 · 13 comments
Labels
enhancement New feature or request

Comments

@MartinKavik
Copy link
Member

MartinKavik commented Mar 9, 2020

@rebo
Copy link
Collaborator

rebo commented Mar 9, 2020

All the above excellent brainstorming, obviously crucial to the moment is systematic profiling / benchmarking to understand the effect of any of the above potential improvements.

@MartinKavik
Copy link
Member Author

Note: I've just added into the above list this link - christian-schilling/seed-quickstart#1. Is the result of the investigation of the slow first rendering in the app with many nodes. I just though it would be interesting for you. (cc @akhilman, @rebo)

@rebo
Copy link
Collaborator

rebo commented Apr 28, 2020

Regarding your Node caching comments on the pull request. This is currently working as part of the hooks infrastructure. I'll upload an example later.

@akhilman
Copy link
Member

WebAssembly Interface Types may also change performance in the future.

@flosse
Copy link
Member

flosse commented Feb 1, 2021

I just compared the filesize of the counter example:

  • seed v0.8.0: 383K
  • yew v0.17.4: 71K
  • dodrio v0.2.0: 80K
  • sauron v0.34.0: 148K
  • mogwai v0.3.6: 94K
  • dominator v0.5.14: 58K

That's a huge difference. Does s.o. know what's the main reason for this?

All were optimized with:

[profile.release]
lto = true
opt-level = 'z'
codegen-units = 1

@MartinKavik
Copy link
Member Author

I just compared the filesize of the counter example: ...

The related issue comment: krausest/js-framework-benchmark#854 (comment)

@flosse
Copy link
Member

flosse commented Feb 2, 2021

I just compared the filesize of the counter example: ...

The related issue comment: krausest/js-framework-benchmark#854 (comment)

thx!

@akhilman
Copy link
Member

akhilman commented Feb 15, 2021

I did twiggy dominators against counter example compiled in debug mode. Here is result.
Seems like serde uses a lot of binary size. We could replace serde json by browsers's json serialization.
== update ==
Or put serde/serialization behind feature flag.

@MartinKavik
Copy link
Member Author

@akhilman If you think you can remove Serde or other dependencies, I will be very glad for a PR. If not possible, then feature flag would be also nice.

@akhilman
Copy link
Member

akhilman commented Feb 17, 2021

@akhilman If you think you can remove Serde or other dependencies, I will be very glad for a PR. If not possible, then feature flag would be also nice.

I've got deeper look and seems we can not just drop serde_json:

Positive part:

  • At least we know why counter so large;
  • More or less complex app will have serde_json anyway.

Todomvc size comparison is not so dramatic:

  • seed: 476K;
  • yew: 344K.

Both includes serde_json.

@MartinKavik
Copy link
Member Author

The large file size caused by Serde seems to be a known fact - serde-rs/serde#286

If we can't remove Serde, can we replace it? I've found some potential options:

@flosse
Copy link
Member

flosse commented Jul 22, 2021

* https://crates.io/crates/miniserde

This one looks promising ... probably we can use it behind a feature flag?

@MartinKavik
Copy link
Member Author

MoonZoon uses serde-lite (without problems so far) instead of miniserde because miniserde is too limited - e.g. it supports only structs according to its docs. However I can imagine both can be hidden behind an associated feature flag. Feel free to create a PR if you manage to make at least one of them work and it really helps your wasm file size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants