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

[browser] Move reflection from JS to C# #98391

Merged
merged 13 commits into from
Feb 15, 2024

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Feb 13, 2024

This decreases hazard of dealing with managed types in JS.
It also reduces the need to MONO_ENTER_GC_UNSAFE
It will allow to initiate bind_assembly_exports from UI to deputy thread.
Allocate gc-roots for monoStringToStringUnsafe earlier.

Contributes to #98366

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm labels Feb 13, 2024
@pavelsavara pavelsavara added this to the 9.0.0 milestone Feb 13, 2024
@pavelsavara pavelsavara self-assigned this Feb 13, 2024
@ghost
Copy link

ghost commented Feb 13, 2024

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

Issue Details

This decreases hazard of dealing with managed types in JS.
It also reduces the need to MONO_ENTER_GC_UNSAFE

Contributes to #98366

Author: pavelsavara
Assignees: pavelsavara
Labels:

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

Milestone: 9.0.0

@pavelsavara pavelsavara marked this pull request as ready for review February 13, 2024 22:05
@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@maraf maraf 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 to me 👍

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

I filled #98486

@radekdoulik
Copy link
Member

Looks like this change increased the cold browser template startup time, probably increased the size. The range is 741c0c8...c34474e

image

Is there anything we can do to improve it?

@lewing
Copy link
Member

lewing commented Feb 15, 2024

I think we should discuss this more, it pulls in a lot more managed code and the long term fix is different.

@pavelsavara
Copy link
Member Author

We can move it back to C/mono, but call it from C# side.
I think that Blazor is full of similar reflection anyway ?

@pavelsavara
Copy link
Member Author

Is there anything we can do to improve it?

I moved it back to C, but called from the managed thread. #98534

Could you please check the perf with this ? @radekdoulik many thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants