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

Benchmark crate for core features #3487

Merged
merged 3 commits into from
Oct 27, 2023
Merged

Conversation

cecton
Copy link
Member

@cecton cecton commented Oct 26, 2023

Description

Add a tool crate benchmark-core where we can run benchmarks on some basic core
features like VNode.

Related to #3431

Checklist

  • I have reviewed my own code
  • I have added tests

github-actions[bot]
github-actions bot previously approved these changes Oct 26, 2023
github-actions[bot]
github-actions bot previously approved these changes Oct 26, 2023
Copy link
Member

@ranile ranile left a comment

Choose a reason for hiding this comment

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

Looks mostly good, just a few comments

Comment on lines +51 to +54
- name: Run master benchmark
run: cargo bench -q > ../output.log
continue-on-error: true
working-directory: yew-master/tools/benchmark-core
Copy link
Member

Choose a reason for hiding this comment

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

We can probably cache this somewhere (perhaps in firestore db or storage bucket, since we already use firebase) but this is fine for now

Copy link
Member Author

Choose a reason for hiding this comment

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

isnt it already cached by the 2 previous steps (swatinem/rust-cache)?

Copy link
Member

Choose a reason for hiding this comment

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

That's true. I was thinking of just downloading the expected output file so benchmark is never run when it can be avoided

Copy link
Member Author

Choose a reason for hiding this comment

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

oh... well. tbh I dont think it's worth the effort haha

@@ -0,0 +1,14 @@
[package]
Copy link
Member

Choose a reason for hiding this comment

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

Curious, why not put it in yew's benches instead of creating a new crate?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know... 🤷‍♀️ well I guess I can simply move them there I guess. I tried to keep the directory architecture with the other benchmarks

Copy link
Member Author

Choose a reason for hiding this comment

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

so what do you prefer? should I move the bench in the crate yew? or keep with a separate crate for consistency sake? both are fine imo i don't really care

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine either way. It doesn't really make that much of a difference and moving it now is just extra work

Comment on lines 17 to 21
<div class={classes!("hello-world")}>
<span>{"Hello"}</span>
<strong style="color:red">{"World"}</strong>
<Stuff />
</div>
Copy link
Member

Choose a reason for hiding this comment

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

We clone only VTag and VComp here. Probably wanna benchmark the others too, especially VList

Copy link
Member Author

Choose a reason for hiding this comment

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

Pretty sure VList is in there because there is a list of nodes.

I'm also cloning classes and style (which are also very important imo).

(and yes the <Stuff/> thingy is purely to get a VComp)

Copy link
Member Author

Choose a reason for hiding this comment

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

(ah and I'm also cloning VText (Hello and World are VText I think)

Copy link
Member

Choose a reason for hiding this comment

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

Oh, right. It's still missing a few cases though: VSuspense and VRef. Not sure if we can benchmark those

Copy link
Member

Choose a reason for hiding this comment

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

@cecton can we benchmark those or should we just merge it in as-is?

Copy link
Member Author

Choose a reason for hiding this comment

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

I could add VSuspense but not VRef

Copy link
Member

@ranile ranile left a comment

Choose a reason for hiding this comment

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

Looks good! Feel free to merge it once (relevent) CI is green

@ranile ranile merged commit 22fd855 into yewstack:master Oct 27, 2023
15 checks passed
@cecton cecton deleted the benchmark-core branch October 27, 2023 12:25
@ranile ranile mentioned this pull request Oct 27, 2023
2 tasks
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