Profiling

The base for the dataset generator I released the the other day uses Sql SMO (the replacement for Sql DMO) to extract the bits and pieces it needs from the database (things like the table schema – What are the names of the columns?, What foreign keys are on a column?, Is the column a primary key? etc) Sql SMO in .Net 2.0 extents the meta data model exposed by Sql DMO and seems a little more intuitive to use. The problem was the dataset generator seemed a little slow at getting the job done – Was it the file access? Was it the string manipulation? Where was the biggest performance hit coming in? This can be very hard to find (you have to guess) and can waste a lot of time improving your program without a tool like a profiler.

The profiler I was using was the Jet Brains Dot Trace 1.1. This is a simple application which launchs your application and then monitors the calls that are going on and how long they take. The report it gives back allow you to drill down and find out what is really going on behind the scenes. The thing I really liked is that it doesnt really seem to interfer with the execution time of your program (not noticably) so it doesnt take long just to fire it up and check out whats going on. The little performance fixes here and there (these can be hard to do even with a profiler – but refactoring with tests should come in handy there 😀 ) can really make a big difference to how useful/good your final program really is 🙂 Its probibly something that a lot of people already know about but I just thought I’d mention it – If your trying to improve the perfromance of your .Net app then a profiler can be one really handy tool – Dot Trace seems to be a good one out there – I’d recommend it 🙂

With the dataset generator I found that the calls to Sql SMO get_Type() were causing the biggest performance hit (after removing a few obvious bits and pieces here and there). I did a few fixes but nothing too major – just not on the highest list of priorites at the moment – it did high light a few interesting bits and pieces in Sql SMO though.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: