-
Notifications
You must be signed in to change notification settings - Fork 548
[dotnet] Add support for generating a binary version of runtimeconfig.json. Fixes #11745. #11887
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
[dotnet] Add support for generating a binary version of runtimeconfig.json. Fixes #11745. #11887
Conversation
….json. Fixes dotnet#11745. Use Mono's RuntimeConfigParserTask to parse the *.runtimeconfig.json file and produce a binary version of it. This way Mono doesn't have to do json parsing at runtime, which makes it possible to make the runtimer smaller and execution faster. This also means implementing support for finding the on-disk location of the file at runtime, and passing it to mono. Ref: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/docs/design/mono/mobile-runtimeconfig-json.md Fixes dotnet#11745.
| <!-- App bundle creation tasks --> | ||
|
|
||
| <Target Name="_CreateRuntimeConfiguration" | ||
| Condition="'$(UseMonoRuntime)' != 'false'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might also check here if $(GenerateRuntimeConfigurationFiles) is true?
If a user sets it to false in their project, I think the *.runtimeconfig.json file would not be created:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm yeah, good point, maybe we could even warn that some features won't work in that case.
spouliot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which makes it possible to make the runtimer
typo runtime[r]
smaller and execution faster.
Any numbers ?
|
|
||
| xamarin_initialize_runtime_config (); | ||
|
|
||
| rv = monovm_initialize (propertyCount, propertyKeys, propertyValues); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not this call reset the values of the config file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the values we pass to the task here:
list the values we will later pass to monovm_initialize, so that the task can make sure there are no duplicates.
This is documented here: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/docs/design/mono/mobile-runtimeconfig-json.md#design-overview
No, I didn't measure this, it's partially mentioned here: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/docs/design/mono/mobile-runtimeconfig-json.md#motivation, but I've also seen it elsewhere (although I don't remember exactly where anymore). |
spouliot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rolfbjarne ah, I see
This way Mono doesn't have to do json parsing at runtime, which makes it possible to make the runtimer smaller and execution faster.
and
To minimize the impact on the app startup time, the design constraints are as follows:
are two different things.
The format minimize the impact (size / perf) versus a textual JSON file.
However that theoretical as we have no such thing today. As such it will not be possible to make the runtime smaller and faster than what we have today.
I'm fine just delete that phrase when committing the PR.
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results2 tests failed, 108 tests passed.Failed tests
Pipeline on Agent XAMBOT-1104.BigSur' |
…runtime config file (and warn if that's not the case).
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results3 tests failed, 112 tests passed.Failed tests
Pipeline on Agent XAMBOT-1104.BigSur' |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results2 tests failed, 173 tests passed.Failed tests
Pipeline on Agent XAMBOT-1102.BigSur' |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results2 tests failed, 173 tests passed.Failed tests
Pipeline on Agent XAMBOT-1104.BigSur' |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
🔥 Tests failed catastrophically on Build (no summary found). 🔥Result file $(TEST_SUMMARY_PATH) not found. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results3 tests failed, 172 tests passed.Failed tests
Pipeline on Agent XAMBOT-1104.BigSur' |
|
Test failures are unrelated
|
|
@rolfbjarne I get this warning (which was introduced by this PR) on a iOS extension: I have not set |
Use Mono's RuntimeConfigParserTask to parse the *.runtimeconfig.json file and
produce a binary version of it. This way Mono doesn't have to do json parsing
at runtime, which makes it possible to make the runtimer smaller and execution
faster.
This also means implementing support for finding the on-disk location of the
file at runtime, and passing it to mono.
Ref: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/docs/design/mono/mobile-runtimeconfig-json.md
Fixes #11745.