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

[JSON source gen 2/3] Add JSON source generator #51300

Merged
5 commits merged into from
Apr 19, 2021

Conversation

layomia
Copy link
Contributor

@layomia layomia commented Apr 15, 2021

Contributes to #45448.

PR 1 - #51149
PR 2 - this PR
PR 3 - #51528

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Apr 15, 2021

Tagging subscribers to this area: @eiriktsarpalis, @layomia
See info in area-owners.md if you want to be subscribed.

Issue Details

Contributes to #45448. Still WIP but ready for a first look.

Author: layomia
Assignees: layomia
Labels:

area-System.Text.Json

Milestone: 6.0.0

@layomia
Copy link
Contributor Author

layomia commented Apr 16, 2021

Here are the remaining items I plan to address for preview 4 in follow-up PRs

  • Add the rest of the new JsonSerializer + System.Net.Http.Json methods / make diagnostic messages localizable
  • Add more tests (All existing features are supported in this PR - except support for all collections; parameterized ctors; some edge cases with JsonInclude)

Other work items I'm tracking for post-preview 4:

@layomia
Copy link
Contributor Author

layomia commented Apr 16, 2021

Thanks folks for the review. I'm still addressing feedback. I'll merge it when it's ready and go to Tactics / back-port to preview 4.

public MetadataLoadContextInternal(Compilation compilation)
{
_compilation = compilation;
Dictionary<AssemblyName, IAssemblySymbol> assemblies = compilation.References
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you see any major performance regression since this happens every build?

Copy link
Contributor Author

@layomia layomia Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really haven't done much build-time throughput testing, but [really] early code-gen perf numbers suggested the build time isn't increasing by a crazy amount. Do you know of a reliable way to measure the perf here that doesn't include noise from other parts of the compilation?

I've taken a note to optimize the generator's implementation (e.g. looking at caching where possible), and also to adopt the incremental source generator pattern being designed.

@danmoseley
Copy link
Member

Kudos for no less than 7 reviewers working together here to help @layomia get this over the finish line for the preview.

@ghost
Copy link

ghost commented Apr 19, 2021

Hello @layomia!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@layomia
Copy link
Contributor Author

layomia commented Apr 19, 2021

/backport to release/6.0-preview4

@github-actions
Copy link
Contributor

Started backporting to release/6.0-preview4: https://github.com/dotnet/runtime/actions/runs/764610593

@layomia
Copy link
Contributor Author

layomia commented Apr 19, 2021

FYI @tdykstra - I'll address any feedback you have in a follow up. Thanks!

@layomia layomia deleted the JsonSourceGenerator branch April 21, 2021 15:59
layomia added a commit to layomia/dotnet_runtime that referenced this pull request May 1, 2021
layomia added a commit that referenced this pull request May 4, 2021
* Address feedback from STJ source-gen PR #51300

* Address review feedback
@ghost ghost locked as resolved and limited conversation to collaborators May 21, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants