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

Remove allocation in vtag diff #591

Merged
merged 9 commits into from
Aug 21, 2019
Merged

Remove allocation in vtag diff #591

merged 9 commits into from
Aug 21, 2019

Conversation

tafia
Copy link
Contributor

@tafia tafia commented Aug 14, 2019

Disclaimer: I couldn't test it on my system yet.

This PR attempts to remove all allocations (String, Vec and HashSet) used in various vtag diff functions.

I believe this should have an impact both in terms of performance and memory.

@jstarry
Copy link
Member

jstarry commented Aug 14, 2019

Awesome, thanks @tafia, I'll run some benchmarks and see what the improvements are!

@jstarry jstarry self-assigned this Aug 14, 2019
Copy link
Member

@jstarry jstarry left a comment

Choose a reason for hiding this comment

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

Unfortunately, there wasn't any movement on the benchmark numbers but this is still a great change! I also would have expected this to improve performance though, not sure why :/ I hope to add some automated benchmarking soon which will make it easier to fight this battle :)

After making the changes, can you please rebase to remove the fmt changes you picked up in src/html? Thanks!

src/virtual_dom/vnode.rs Show resolved Hide resolved
src/virtual_dom/vtag.rs Outdated Show resolved Hide resolved
src/virtual_dom/vtag.rs Outdated Show resolved Hide resolved
src/virtual_dom/vtag.rs Outdated Show resolved Hide resolved
src/virtual_dom/vtag.rs Outdated Show resolved Hide resolved
@tafia
Copy link
Contributor Author

tafia commented Aug 19, 2019

I've applied the suggestions. I am a bit surprised that there is no impact, sorry for having you lose your time!
I have some other ideas for change but I am not sure they'll pay out.

@tafia
Copy link
Contributor Author

tafia commented Aug 19, 2019

Note that I haven't put the not fn in utils because it didn't really match the module comments:

 This module contains useful utils to get information about the current document.

I can put it there if needed.

@jstarry jstarry removed their assignment Aug 19, 2019
@jstarry
Copy link
Member

jstarry commented Aug 21, 2019

No worries at all! Happy for your contribution and would gladly accept more PRs like this one. Sorry for the slow review, looks great!!

@jstarry
Copy link
Member

jstarry commented Aug 21, 2019

bors r+

bors bot added a commit that referenced this pull request Aug 21, 2019
591: Remove allocation in vtag diff r=jstarry a=tafia

**Disclaimer**: I couldn't test it on my system yet.

This PR attempts to remove all allocations (`String`, `Vec` and `HashSet`) used in various vtag diff functions.

I believe this should have an impact both in terms of performance and memory.



Co-authored-by: Johann Tuffe <tafia973@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 21, 2019

Build succeeded

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 048865f into yewstack:master Aug 21, 2019
@tafia tafia deleted the diff_alloc branch August 21, 2019 06:30
@tafia
Copy link
Contributor Author

tafia commented Aug 21, 2019

Sorry for the slow review,

Trust me I am much slower nowadays!

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.

2 participants