<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/code-performance-analysis-in-visual-studio-2008-fyhsdggqh" -->

---
title: Code performance analysis in Visual Studio 2008 | daily.dev
description: A walkthrough demonstrates how to use the performance analysis (profiling) tool built into Visual Studio 2008's Analyze menu. Using a sample Windows Forms app...
canonical: https://daily.dev/posts/code-performance-analysis-in-visual-studio-2008-fyhsdggqh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Code performance analysis in Visual Studio 2008 | daily.dev
og:description: A walkthrough demonstrates how to use the performance analysis (profiling) tool built into Visual Studio 2008's Analyze menu. Using a sample Windows Forms app...
og:url: https://daily.dev/posts/code-performance-analysis-in-visual-studio-2008-fyhsdggqh
og:image: https://api.daily.dev/og/posts/FYHsdggqH.png
og:image:alt: Code performance analysis in Visual Studio 2008
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Code performance analysis in Visual Studio 2008

**[Maarten Balliauw](https://daily.dev/sources/maartenballiauw)** · 4 min read · 0 upvotes · 0 comments

## Summary

A walkthrough demonstrates how to use the performance analysis (profiling) tool built into Visual Studio 2008's Analyze menu. Using a sample Windows Forms app that inefficiently concatenates strings 1,500 times, it shows how to run sampling and instrumentation profiling sessions, enable .NET object allocation tracking, and identify the string.Concat() bottleneck via the Caller/Callee view or the new hotpath tracking flame icon. The fix replaces string concatenation with StringBuilder, and the post also covers comparing performance reports to see deltas between runs. Updates note the Analyze menu requires Developer or Team Edition of Visual Studio.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.maartenballiauw.be/posts/2008-02-07-code-performance-analysis-in-visual-studio-2008>

## Questions this post answers

### Why is using string.Concat() in a loop bad for performance in C#?

Repeatedly using string.Concat() in a loop creates a new string object on every iteration because strings are immutable, forcing the old intermediate strings to be garbage collected. In a test looping 1,500 times, string.Concat() consumed 97% of the application's memory according to Visual Studio 2008's profiler, making it a clear smell to fix.

_Developers chasing memory bloat in loops can track string-handling pitfalls like this on daily.dev._

### How do I find which method is causing excessive memory allocation in Visual Studio 2008?

Use the Analyze menu's Performance Wizard with instrumentation profiling, then enable 'Collect .NET object allocation information' and 'Also collect .NET object lifetime information' in the session properties. After running the app, right-click the costly function in the summary report and choose 'Show functions calling Concat' to jump to the Caller/Callee view, or use the hotpath flame icon in the Call Tree view to drill down automatically.

_Anyone debugging allocation hotspots can keep profiling techniques like this handy via daily.dev._

### How do I fix slow string concatenation performance in a C# loop?

Replace repeated string.Concat() calls with a StringBuilder, appending each piece with sb.Append() inside the loop and calling sb.ToString() once at the end. Rerunning the Visual Studio profiler on this rewritten version showed the memory and performance issue was resolved compared to the original concatenation approach.

_Developers optimizing hot loops can revisit StringBuilder patterns like this through daily.dev._

## Similar posts on daily.dev

- [Delegate the analysis, not the performance](https://daily.dev/posts/delegate-the-analysis-not-the-performance-gyy6iudtk) · Visual Studio Blog · 0 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#c#](https://daily.dev/tags/c#), [#visual-studio](https://daily.dev/tags/visual-studio)

[View this post on daily.dev](https://daily.dev/posts/code-performance-analysis-in-visual-studio-2008-fyhsdggqh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Code performance analysis in Visual Studio 2008","url":"https://daily.dev/posts/code-performance-analysis-in-visual-studio-2008-fyhsdggqh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/code-performance-analysis-in-visual-studio-2008-fyhsdggqh"},"datePublished":"2026-10-04T13:06:12.903Z","dateModified":"2026-10-04T13:19:26.025Z","description":"A walkthrough demonstrates how to use the performance analysis (profiling) tool built into Visual Studio 2008's Analyze menu. Using a sample Windows Forms app...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0495f283a3716c765150a4a1b22e4d88?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0495f283a3716c765150a4a1b22e4d88?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Maarten Balliauw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Maarten Balliauw","logo":"https://media.daily.dev/image/upload/s--rOTg3VYO--/f_auto,q_auto/v1791119043/logos/maartenballiauw?_a=BAMAMicg0","url":"https://daily.dev/sources/maartenballiauw"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/code-performance-analysis-in-visual-studio-2008-fyhsdggqh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,c#,visual-studio","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Maarten Balliauw","item":"https://daily.dev/sources/maartenballiauw"},{"@type":"ListItem","position":3,"name":"Code performance analysis in Visual Studio 2008"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/code-performance-analysis-in-visual-studio-2008-fyhsdggqh#faq","mainEntity":[{"@type":"Question","name":"Why is using string.Concat() in a loop bad for performance in C#?","acceptedAnswer":{"@type":"Answer","text":"Repeatedly using string.Concat() in a loop creates a new string object on every iteration because strings are immutable, forcing the old intermediate strings to be garbage collected. In a test looping 1,500 times, string.Concat() consumed 97% of the application's memory according to Visual Studio 2008's profiler, making it a clear smell to fix. Developers chasing memory bloat in loops can track string-handling pitfalls like this on daily.dev."}},{"@type":"Question","name":"How do I find which method is causing excessive memory allocation in Visual Studio 2008?","acceptedAnswer":{"@type":"Answer","text":"Use the Analyze menu's Performance Wizard with instrumentation profiling, then enable 'Collect .NET object allocation information' and 'Also collect .NET object lifetime information' in the session properties. After running the app, right-click the costly function in the summary report and choose 'Show functions calling Concat' to jump to the Caller/Callee view, or use the hotpath flame icon in the Call Tree view to drill down automatically. Anyone debugging allocation hotspots can keep profiling techniques like this handy via daily.dev."}},{"@type":"Question","name":"How do I fix slow string concatenation performance in a C# loop?","acceptedAnswer":{"@type":"Answer","text":"Replace repeated string.Concat() calls with a StringBuilder, appending each piece with sb.Append() inside the loop and calling sb.ToString() once at the end. Rerunning the Visual Studio profiler on this rewritten version showed the memory and performance issue was resolved compared to the original concatenation approach. Developers optimizing hot loops can revisit StringBuilder patterns like this through daily.dev."}}]}
```

