Skip to content

[wasm] reduce eval in production code - #71932

Merged
pavelsavara merged 3 commits into
dotnet:mainfrom
pavelsavara:wasm_reduce_eval
Jul 11, 2022
Merged

pavelsavara merged 3 commits into
dotnet:mainfrom
pavelsavara:wasm_reduce_eval

Conversation

@pavelsavara

Copy link
Copy Markdown
Member

Fixes #61287

@pavelsavara pavelsavara added this to the 7.0.0 milestone Jul 11, 2022
@pavelsavara
pavelsavara requested a review from maraf July 11, 2022 10:43
@pavelsavara
pavelsavara requested a review from lewing as a code owner July 11, 2022 10:43
@pavelsavara pavelsavara self-assigned this Jul 11, 2022
@ghost

ghost commented Jul 11, 2022

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #61287

Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone: 7.0.0

@pavelsavara

Copy link
Copy Markdown
Member Author

cc @kg

- update benchmark to use JSExport/JSImport instead of reflection
@pavelsavara
pavelsavara requested a review from marek-safar as a code owner July 11, 2022 13:29
@pavelsavara

Copy link
Copy Markdown
Member Author

Sorry guys, I realized that there is still usage in the benchmark.
That also forced me to fix JSExport from nested class.

@pavelsavara
pavelsavara requested review from kg, maraf and radekdoulik July 11, 2022 13:31
Comment thread src/mono/sample/wasm/browser-bench/Program.cs
@pavelsavara
pavelsavara merged commit 4a2ebf2 into dotnet:main Jul 11, 2022
@pavelsavara
pavelsavara deleted the wasm_reduce_eval branch July 14, 2022 20:48
@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2022
@kg

kg commented Jan 25, 2023

Copy link
Copy Markdown
Contributor

https://radekdoulik.github.io/WasmPerformanceMeasurements/?startDate=2022-07-11T19%3A31%3A11.000Z&endDate=2022-07-11T21%3A06%3A41.000Z&tasks=%2CAppStart&flavors=2

The time increase in this doesn't make any sense given the change in question, seems like variance?

@lewing

lewing commented Jan 25, 2023 •

Copy link
Copy Markdown
Member

cae954a...4a2ebf2 is the only commit in the diff and it changes the test mechanism. it was known and mostly fixed with the lazy init I think

@pavelsavara

pavelsavara commented Jan 25, 2023 •

Copy link
Copy Markdown
Member Author

Yes, I had to rewrite the benchmark to stop using eval code path and so I introduced dependency on JSExport into benchmark. The implementation at the time was triggering static constructors of the containing class during runtime init. That's now fixed in #77293

@radekdoulik

Copy link
Copy Markdown
Member

https://radekdoulik.github.io/WasmPerformanceMeasurements/?startDate=2022-07-11T19%3A31%3A11.000Z&endDate=2022-07-11T21%3A06%3A41.000Z&tasks=%2CAppStart&flavors=2

yup, it is #75598 and Pavel fixed it in #77293. the static constructors were doing a lot of work, which was not needed during startup

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[wasm] avoid eval, design better API for InvokeJS

5 participants