New hostfxr hosting API design - discussion

Open
#112,984 28 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, ios, wasm
Domain
api, mobile-dev

Research direction

Start by reviewing the public hostfxr APIs and the private coreclr_initialize approach described in the issue. Gather hosting requirements from the iOS, Android, and WASM scenarios; done means the requirements are agreed and a performant hosting API design is defined.

Written by the indexing model from the issue text.

Description

area-Host discussion os-android os-browser os-ios os-wasi

Description

It is needless to say that startup performance is critical for mobile applications. As we are exploring the support of CoreCLR for mobile we have identified several inefficiencies with currently available hosting APIs which need to be addressed in order to achieve best performance possible.

One example of such inefficiency is related to how the runtime properties can be passed to the runtime during initialization.
If we consider CoreCLR's private hosting APIs, like coreclr_initialize, runtime configuration properties' values are accepted as UTF8 strings. Which means that pointers need to be converted to UTF8 strings which are internally converted back to pointers. The conversion pointer-string-pointer seems redundant and negatively impacts the performance during startup. Additionally, this conversion could break tagged pointers on ARMv8+.
On the other hand, the public hosting hostfxr APIs support passing runtime configuration properties as a json file, which is also not ideal.

Going forward, we would like to avoid using private hosting APIs and use hostfxr APIs instead.

The goal of this issue is to open up a discussion between our hosting and iOS/Android/WASM experts in order to collect list of requirements specific to each platform and from that design new highly performant hosting API to successfully support CoreCLR on them.

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.