Skip to content

CheckFormatStrings.parseFormatStringInternal appears to split source files many times over causing LOH allocations #5922

@davkean

Description

@davkean

Trace: https://developercommunity.visualstudio.com/content/problem/379694/another-repro-trace-for-github-bug-4718.html
Trace: https://developercommunity.visualstudio.com/content/problem/245786/slow-f-editing-experience-up-to-a-minute-until-typ.html

GC Rollup By Generation

Gen Count MaxPause MaxPeak MB Max AllocMB/sec TotalPause TotalAlloc MB Alloc MB/MSec GC Survived MB/MSec GC MeanPause Induced
ALL 506 953.4 2,638.9 116,179.562 18,629.5 231.4 0.0 34.716 36.8 0
0 443 12.7 2,638.9 116,179.562 2,303.8 93.8 10.0 0.037 5.2 0
1 43 13.2 2,636.8 96.406 265.3 -1.6 1.1 0.228 6.2 0
2 20 953.4 2,638.9 1.985 16,060.4 139.1 69.4 677.189 803.0 0

In the above trace, we noticed that we had a tonne of Gen2 collections due to LOH allocations. The first one we noticed that parseFormatStringInternal splits (what appears to be) the source file many times over. For large source files these all end up on the LOH heap:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions