Skip to content

Performance degradation of StackFrameHelper that's shipped with 4.7.1 #529

@batkaevruslan

Description

@batkaevruslan

Run this code

public static void Main()
{
   for (int i = 0; i < 10000; i++)
   {
      new StackTrace(true).GetFrames();
   }
}

on Windows10 with .net 4.7.1 and it will take 5 seconds to complete.
Run this code on the same system without 4.7.1 and it will take 200ms

There is performance degradation in System.Diagnostrics.StackFrameHelper.InitializeSourceInfo

image

Looks like caching is broken and pdb files are loaded every time
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions