Skip to content

[Performance]: Task Telemetry #12882

@SimaTian

Description

@SimaTian

Issue Description

ProjectTelemetry.cs class issues

after enlightening most of sdk tasks, I've run into a contention condition happening.
This was due to the
private readonly Dictionary<string, int> _taskHostTaskUsage
being accessed by multiple threads while logging Telemetry for task usage.

Unfortunately, the most direct fix Dictionary -> ConcurrentDictionary causes a regression - see here
The regression is large enough to remove any potential improvement gained by enlightening further tasks.

Steps to Reproduce

change the dictionaries in ProjectTelemetry.cs to ConcurrentDictionary
run a multithreaded build. (what's worse, the regression is clearly visible even in the normal build)

Data

#12866

Analysis

locking the files to avoid contention causes time loss

Versions & Configurations

No response

Regression

  • yes
  • no

Regression Details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:2Work that is important, but not critical for the releasetriaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions