Steps to reproduce
- Open Perfview, capture a trace
- Use ILSpy to do some searching/navigation
- Stop trace, check allocation stack
CSharpLanguage.ToCSharpString usage of StringBuilder not optimal, it's calling bunch of StringBuilder.Insert(0, x), then StringBuilder.ToString. In most case, there should be ony a single string, so no allocation is needed.
For more detailed analysis/suggestion: check
https://www.linkedin.com/feed/update/urn:li:activity:7097628892848410624/
https://app.beehiiv.com/posts/b3c9d7bb-56ec-4a71-8070-78e23cbc2c80/analytics
Steps to reproduce
CSharpLanguage.ToCSharpString usage of StringBuilder not optimal, it's calling bunch of StringBuilder.Insert(0, x), then StringBuilder.ToString. In most case, there should be ony a single string, so no allocation is needed.
For more detailed analysis/suggestion: check
https://www.linkedin.com/feed/update/urn:li:activity:7097628892848410624/
https://app.beehiiv.com/posts/b3c9d7bb-56ec-4a71-8070-78e23cbc2c80/analytics