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

Is a wasm-bindgen-bench crate possible today? #828

Open
chinedufn opened this issue Sep 14, 2018 · 4 comments
Open

Is a wasm-bindgen-bench crate possible today? #828

chinedufn opened this issue Sep 14, 2018 · 4 comments

Comments

@chinedufn
Copy link
Contributor

I know that you can write your own test runners, but could you also do this:

#[wasm_bindgen_bench]
fn my_benchmark() {
  // ...
}

?


The impetus here is me working on a renderer and wanted an easily compare potential performance enhancements in real browsers.

Something like this would make that trivial... but I don't know if this is even technically possible at this time?

Cheers!

@fitzgen
Copy link
Member

fitzgen commented Sep 14, 2018

It should be possible, yes! I've been thinking about trying to port criterion over to wasm: https://docs.rs/criterion/0.2.5/criterion/

@chinedufn
Copy link
Contributor Author

Woah smooth - thanks a lot for the link!

I'm curious - in your mind is it more or less a straight up port or are there a bunch of wasm specific considerations that would come into play?

In the meantime I'll give criterion and wasm-bindgen-test a read to get more familiar...

Should this issue be left open to maybe lay out what benchmarking support might look like?

@fitzgen
Copy link
Member

fitzgen commented Sep 14, 2018

I haven't looked into criterion's code at all yet, just something in the back of my mind. I've only used it, and been very pleased with the result.

Yeah, we can keep this issue open to discuss :)

@flosse
Copy link

flosse commented Mar 4, 2022

Does the new WASM support of criterion have any impact to this issue?

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

No branches or pull requests

3 participants