Skip to content

Optimize ReaderWriterLockSlim  allocations #14769

Description

@AR-May

PR #12264 added a per-instance  ReaderWriterLockSlim  to  PropertyDictionary<T>  to prevent concurrent modification during enumeration. Because  PropertyDictionary<T>  is created frequently during evaluation and  ProjectInstance  construction, this adds a relatively large lock object to every instance.

In an OrchardCore design-time build,  ReaderWriterLockSlim account for approximately 71.84 MB of allocations across six MSBuild worker processes. Almost all are attributed to this per-instance allocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions