InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Visual Studio 2010 Feature Focus: Profiling and Debugging Parallel Applications

Posted by Jonathan Allen on Oct 14, 2008

Sections
Development,
Architecture & Design
Topics
Debugging ,
Performance & Scalability ,
.NET ,
IDE
Tags
Parallel Programming ,
Visual Studio

Visual Studio 2010 will bring a new focus on profiling and debugging parallel applications. One of the primary issues they are trying to address is the black box between source code at design time and the code at runtime. At design time the code is presented in a declarative fashion using PLINQ or Parallel.For, while at run time it is seen in terms of individual threads. What happens between those two layers is a deep mystery as far as the debugger is concerned. To address this Microsoft wants to move the debugger's focus to a higher level of abstract, namely the task level.

To understand how this will work, it is important to understand that both PLINQ and Parallel.For are built on the Task Parallel Library. Though grossly simplified, one can think of a parallel operation as a collection of Tasks, which in turn are run on top of a collection of threads.

To see what is happening in a task in today's VS, the developer needs to check each thread individually. With VS 2010, a new window shows tasks directly. Each task is shown as a box containing its call stack and the arguments passed in. Multiple tasks sharing a common call stack will be listed in the same box. If tasks have a common base but diverge further down in the call stack, they are shown as a common box with separate child boxes hanging off them.

Instead of stacks, one can also look at a method view. This focuses on a given method regardless of how it is called, with parent and child boxes for each method that calls or is called by the selected method.

A separate view shows how tasks are related to the child tasks it created. By default this is a hierarchal grid with information such as whether or not the task has been started and what it is waiting on. Grouping and sorting by any column is allowed.

On the profiling front, three new tools are being presented. The first is a trace that shows CPU utilization on a pre-core basis. For each time slice a stacked bar shows how many cores were used by the application, idle, or used by other system processes. This allows developers to quickly see whether or not an application is consuming all the resources offered to it.

The next tool shows a timeline for each thread. At any given point the call stack and delay times for the thread is available. Delays are grouped by type such as code execution, waiting for a lock, or waiting on IO. When using constructs like Parallel.For, markers will indicate when the parallel loop started and finished.

The third shows how threads are mapped to cores. Displayed in a time-line fashion, one can quickly see if the color-coded threads are migrating from core to core or are being context-switched too often. This is important because every time a thread jumps to a different core there is a good chance the high-speed caches in the CPU will be invalidated.

Steve Teixeira, Daniel Moth, and Sean Nordberg presented these features in a Channel 9 video.

No comments

Watch Thread Reply

Educational Content

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.