Ayende @ Rahien

Unnatural acts on source code

NH Prof New Feature: Diffing Sessions

It is very common to use NH Prof as.. well, a profiler :-) That is, we execute a piece of code, look at the profiler output, and try to improve it.

The problem is that when you are working on big applications, a single request may perform quite a bit of work. That can make it harder to figure out the changes between the first session and the optimized session.

In order to make this easier, I added a feature that allows you to compare two sessions, see what statements were added, what were removed and what matches.

image

The UI to show it is only temporary, as you can probably guess, I am still considering some variation of that vs. a flat list with color codes or icons to mark matching, added and removed.

image

Comments

Johannes Rudolph
08/07/2009 10:18 AM by
Johannes Rudolph

you could use a user definable diff tool, e.g diffmerge.

You could take a look at mercurial how it handles this scenario. Most users of NHProf will have a diff tool installed anyway

Matt
08/07/2009 11:36 AM by
Matt

Great feature. Can't wait to try it. But using a diff tool is a horrible idea.

Johannes Rudolph
08/07/2009 12:11 PM by
Johannes Rudolph

Why is a diff tool a horrible idea?

if i have a short diff in NHProf (the +/- thing) but can also have a detailed, fullscreen diff for long queries, that would be nice imho

Jeff Brown
08/13/2009 11:12 AM by
Jeff Brown

An integrated structural diff would be nice to have. It doesn't need to use an external text-based program.

To get a head start, feel free to grab the Diff implementation from Gallio and repurpose it to diff arbitrary sequences of objects instead of strings of characters. ( code.google.com/.../Diff.cs)

OTOH, when diffing profile runs it might be less interesting which order statements execute as the number of time statements of a given kind execute. So it's possible a structural diff would actually be worse for usability sometimes.

Comments have been closed on this topic.