Skip to content

Consider using the converters and JsonClassInfo from s_defaultOptions by cloning #32357

Closed

Description

@ahsonkhan

internal JsonClassInfo GetOrAddClass(Type classType)
{
_haveTypesBeenCreated = true;
// todo: for performance and reduced instances, consider using the converters and JsonClassInfo from s_defaultOptions by cloning (or reference directly if no changes).
if (!_classes.TryGetValue(classType, out JsonClassInfo? result))
{
result = _classes.GetOrAdd(classType, new JsonClassInfo(classType, this));
}
return result;
}

cc @steveharter

Activity

  1. added this to the 5.0 milestone on Feb 15, 2020
  2. added
    untriaged
    on Feb 15, 2020
  3. removed
    untriaged
    on Feb 15, 2020
  4. self-assigned this
    on Jun 25, 2020
  5. steveharter commented on Aug 4, 2020

    @steveharter
    Contributor

    The comment and a cloning approach is feasible, but moving to Future since it will tie together with memory conservation work planned for Future by #1568

  6. modified the milestones: 5.0.0, Future on Aug 4, 2020
  7. removed their assignment
    on Jan 19, 2021
  8. ghost closed this as completedon Nov 5, 2021
  9. ghost locked as resolved and limited conversation to collaborators on Dec 5, 2021
  10. added
    backlog-cleanup-candidate
    on Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Text.Jsonbacklog-cleanup-candidatetenet-performance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions