Skip to content

Sketch of an interface that bypasses the HostObject code#621

Closed
AnsisMalins wants to merge 2 commits intoClearFoundry:masterfrom
AnsisMalins:iv8hostobject
Closed

Sketch of an interface that bypasses the HostObject code#621
AnsisMalins wants to merge 2 commits intoClearFoundry:masterfrom
AnsisMalins:iv8hostobject

Conversation

@AnsisMalins
Copy link
Copy Markdown
Contributor

Here is my current proposed solution to getting rid of all GC allocations when calling methods on host objects from JavaScript. The client code would implement the IV8HostObject interface and deal with all the callbacks itself. Functionality would be added to all the Std and V8 types in V8SplitProxyHelpers.cs so that they could be manipulated without GC allocations.

Please tell me if you would merge anything like this.

@AnsisMalins
Copy link
Copy Markdown
Contributor Author

If you prefer, instead of modifying the types in V8SplitProxyHelpers.cs, I could create lookalikes like Unsafe.StdString, etc. for the public API.

@ClearScriptLib
Copy link
Copy Markdown
Collaborator

Hi @AnsisMalins,

Thanks for posting your PR. As we discussed elsewhere, a number of enhancements intended to reduce managed heap pressure are in the works for ClearScript 7.5.

Based on a quick look, your proposal is very much like our upcoming Fast Proxy API, which similarly features a new host object interface that supports the passing of arguments in their unmanaged form, enabling zero-allocation host member access.

Thanks again!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants