Tim Scott

All things for a good .NET geek

  Home  |   Contact  |   Syndication    |   Login
  36 Posts | 0 Stories | 4 Comments | 33 Trackbacks

News


Archives

Post Categories

Image Galleries

Coding

TechEd

Tuesday, July 24, 2007 #

So we had some forms in our .NET application that were slow. I took the opportunity to try out some .NET Profiling tools. 

  • CLRProfiler
  • Red-Gates ANTS Profiler
  • JetBrains dotTrace
  • Speed Trace Pro

CLRProfiler

Not too useful for my application.  I couldn't figure out how to easily track down slow code with it.

ANTS Profiler

The source code view of this profiler is awesome. It shows you line-by-line execution time for statements, highlighting the slowest lines with a bargraph in the margin.  Very useful.

Hard to find the slowest method in an overall execution path, as it sums the perf stats for all calls to a method. Filtering is tough to use, navigating methods is painful, and it feels very bare-bones.

dotTrace

This profiler was the most useful for finding my slow code.  It shows a by-executing tree of the call stack, with the time taken by each level summarized.  It makes it very easy to keep drilling down to find the slowest method.

Unfortunately, other than execution time for a method, it is hard to see where a method is slow. ANTS Profiler is much more suited to this.

Speed Trace Pro

Similar data to the ANTS Profiler, but with a much better UI than ANTS.  Shows caller/callee tree like dotTrace, but not quite as easy to navigate. Nice pie charts.

It crashed while I was using it. Oops!

Summary

Ideally, I'd like dotTrace to incorporate a source code view like ANTS Profiler. That would be perfect.


Thursday, January 25, 2007 #

I don't remember where I heard about it, but there's a hard disk monitoring utility that I've tried on on two of my computers.

It's very useful--it monitors drive temperature and SMART status.  The temperature was something I was worried about with a new external SATA drive I had purchased a while back.  I was using the 500GB drive to store and access video files during encoding for DVD authoring.  So, getting the best performance from the drive without frying it was very important.  Anyway, HDDlife let me monitor it to make sure temperatures were under control.

It can also remind you if remaining space gets too low--if you've ever run windows out of free space, it dies a very very slow painful death.  HDDlife will warn you before you get to that point.

One strange thing is that it reports my external SATA drive twice. It shows up under Hard Drive 1 and Hard Drive 2 (in addition to the main system Drive 0).  Strange, but it still works ok.

There is also a Google sidebar plug in that looks pretty cool.

Anyway, you can go and learn details about HDDlifeAnd yes, this is a (potentially) paid advertisement.  But it's all still true.

EDIT: This isn't a paid advertisement...they never sent me the product for free. A mark against them.  Woooo.


Tuesday, January 23, 2007 #

A while back I was messing around with Yahoo Widgets. I thought it might be helpful to have a schema so that my XML editor would help with auto-complete and validation.  As far as I could tell, there wasn't an XSD for the widget format.

So, I wrote my own. This one isn't complete, but it's a good start for someone who is looking for a starting point.

View it at http://monoport.com/1556, an ad-free pastebin site.


Saturday, October 07, 2006 #

I know, it's been a long time since I blogged. Life happens.

Anyway, I'm trying out Live Writer for posting to this blog. Maybe I'll post more now.


Tuesday, February 21, 2006 #

Dave Green has a great post on the three different styles of workflows in Windows Workflow Foundation. Read it to find about out Sequential, State Machine and Data-Driven. Plus he gives good examples on how to decide which style to use.

If you haven't heard about Windows Workflow Foundation, check out the official site and the MSDN site.

Finally, Sam's Publishing has published Presenting Windows Workflow Foundation, but I haven't read it yet.


Wednesday, December 28, 2005 #

Ok, I want to play with this some more and blog about it...but to help me to remember I'll post this blurb:

Using DSL Tools, you can create a custom graphical designer that uses your domain-specific diagram notation. You can then create custom text templates that use models created in your designer to generate source code and other files. In this release the validation framework makes it easy to apply constraints to the language, and you can deploy the designer as a standard installer package for use within Visual Studio...
(more)

So what's a domain-specific language, and what is it useful for? I'll have to leave those answers for later.


Sunday, November 06, 2005 #

We've been investigating alternatives to MSDE for a recent project. Firebird was one of the alternatives we investigated. Today I saw in a blog post another possibility that we will consider: VistaDB for .NET
VistaDB 2.1 database for .NET has been released

This 2.1 update includes over 60 improvements, including new support for .NET 2.0 and Visual Studio 2005. VistaDB is a small-footprint, embedded SQL database alternative to Jet/Access, MSDE and SQL Server Express 2005 that enables developers to build .NET 1.1 and .NET 2.0 applications. Features SQL-92 support, small 500KB embedded footprint, free 2-User VistaDB Server for remote TCP/IP data access, royalty free distribution for both embedded and server, Copy 'n Go! deployment, managed ADO.NET Provider, data management and data migration tools. Free trial is available for download.

It looks pretty good: Faster than Access or MSDE, XCOPY deployment, ADO.NET Data Provider, etc, etc. We'll have to check it out. Apparently VistaDB does not support stored procedures, but their upcoming 3.0 release will offer "Stored Code", a way to embed C# code in at the DB layer. Sounds interesting. I'll post more details after we get to play with it.

Wednesday, October 26, 2005 #

JezB asked a question on microsoft.public.dotnet.framework.windowsforms about how to draw a nice soft shadow behind a rectangular object.  I suggested that one way would be to use image slicing and scaling, as per the “old HTML image table” trick.:

Make a blurred rectangle in your favorite graphics program. I used Photoshop:

Now slice the image into 9 parts, keeping the corners as small as possible but still large enough to contain the entire "corner" part of the image. In this enlarged sample, the blue lines indicate where we are going to slice the image:

Now save those 9 parts as image files or embedded resources in your project. At runtime, use Graphics.DrawImage to strech the images as needed. You'll need to stretch (or shrink the edge parts) to match the size of the shadow rectangle that you are trying to make. Using the same parts, you can make different shadow rectangles. The borders are turned on so you can see how it goes together:

We can make it larger just by streching the edges and middle, leaving the corners the same size:

With borders on, so you can see where we stretch it:
This example was shown with HTML, but the same principles would apply when using Graphics.DrawImage. But after all of that, I like the method in Bob Powell's GDI+ faq much better.

Tuesday, October 11, 2005 #

So I stumbled across a post by Michael Kaplan that mentioned something about text rendering in WinFX:

And two thoughts struck me: “Yay, they fixed Graphics.MeasureString” and “what?!  why didn't they fix Graphics.MeasureString?”  Well, no, they didn't fix Graphics.MeasureString and DrawString, as that might break .NET 1.0 and 1.1 apps that are already in the wild.  So they provided the new (and hopefully correct) functionality in the TextRenderer class.  I guess that makes sense.

It also looks like TextRenderer uses GDI to render the text, as opposed to Graphics using GDI+.  Arg!  Fix GDI+!


Wednesday, September 14, 2005 #

At the PDC today, more details on Acrylic have been released. It's now called Expression, and consists of three products:
  1. Graphic Designer - Derived from the Acrylic we saw in the CTP release, still targets Avalon
  2. Interactive Designer - Also called "Sparkle", for creating interactive content
  3. Web Designer - "Quartz", a standards-based rich designer for web sites

Sparkle looks very interesting. It looks like you can import:

  • Graphics from Acrylic, including vector, bitmap, and XAML
  • Video
  • Audio
  • 3D content from other modelling applications, or create simple models directly in Sparkle
  • Text (of course)

Once you have that content in Sparkle, you can add animation, interactions, behaviours, keyframes, etc..It seems targetted to graphic designers, but fully capable of working the programming world--the object model seems to be addressable by C# or other .NET code.

It looks like Sparkle can deliver content as several types:

  • Video presentations (including HD)
  • A Windows application (exe)
  • A Secure Web Browser Application (wba)
  • XAML and C# code for integration into your Visual Studio 2005 project.

The inevitable comparisions to Flash are going to be made, and that's fine.  But if Sparkle can truly bridge the gap between designers and programmers, it is going to go much further than Flash ever did.

More details on the Expression website.


Tuesday, August 16, 2005 #

While at TechEd, I made a prediction about Avalon, XAML, and a surprise from Microsoft:
So, based on my read of just a couple msft guys, and seeing things in the community for a while, here's my read on the situation: They want to deliver Avalon (WinFX) with VS 2005 in November--they're holding it back as their 'big splash.' They've been so open about everything else, they still need something to make the VS 2005 launch a big deal. And I think that big deal will be an Avalon designer, and release runtime for WinXP along with the VS 2005 launch.
Today we know how that Avalon designer will be released: As Acrylic, Microsoft's bitmap and vector graphic design application. The pieces where there, I shoulda seen it coming. Anyway, check out the new beta of Acrylic. It will include "support for the Windows Presentation Foundation (formerly code named Avalon) coming in Windows Vista." So, download the new beta, try out some XAML apps, and post your experiences here.

Friday, July 22, 2005 #

At some point the IDE would lock up whenver I pinned the toolbox open.

I “fixed” it by deleting the file toolbox.tbd found in %USERPROFILE%\Local Settings\Application Data\Microsoft\VisualStudio\7.1\

But a cow-orker of mine had the same problem, and deleting that file didn't work.  So--best of luck if you are having this problem.  If you know of an official fix for this, please let me know.


Tuesday, June 28, 2005 #

Help science! Participate in MIT's blog survey:

Take the MIT Weblog Survey

Update: I've put a project and binaries up for the projectile demo. You can download at http://projectdistributor.net/Releases/Release.aspx?releaseId=209

I ran across a posting on the main geekswithblogs page. Aaron R had written about some projectile physics calcs. It reminded me of some graphics programs I wrote on my HP-48GX. So just for fun I used his sample calc to write a simple ballistics simulator:

Just some simple math, but it was fun. Once I get a group created on Project Distributor, I'll put up the code.

Update: I've put a project and binaries up, you can download at http://projectdistributor.net/Releases/Release.aspx?releaseId=209