Skip to content

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

Merged
pavelsavara merged 13 commits into
dotnet:mainfrom
pavelsavara:browser_reflection
Feb 15, 2024
Merged

[browser] Move reflection from JS to C##98391
pavelsavara merged 13 commits into
dotnet:mainfrom
pavelsavara:browser_reflection

Conversation

@pavelsavara

@pavelsavara pavelsavara commented Feb 13, 2024

Copy link
Copy Markdown
Member

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

ghost commented Feb 13, 2024

Copy link
Copy Markdown

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 requested a review from maraf February 13, 2024 22:00
@pavelsavara pavelsavara marked this pull request as ready for review February 13, 2024 22:05
@pavelsavara pavelsavara requested a review from lewing as a code owner February 13, 2024 22:05
@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread src/mono/browser/runtime/debug.ts
Comment thread src/mono/browser/runtime/invoke-cs.ts Outdated
Comment thread src/mono/browser/runtime/managed-exports.ts
Comment thread src/mono/browser/runtime/run.ts

@maraf maraf left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member Author

I filled #98486

@radekdoulik

Copy link
Copy Markdown
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

lewing commented Feb 15, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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