Archive for March, 2006

Post it up – Coding Environments

March 4, 2006

I thought I better say sorry for not posting for a while – as a dedicated coder it has been hurting not being at my pc lately 😀 After a few big coding sessions and a bit of stuff at work I noticed my arm was getting a bit sore – didn’t improve – got worse and seems to just be coming right now only after giving it a solid rest for a week or so (no after hours coding 😦 ). I always thought OOS etc was not something to really worry about – I havent had any issues before and dont think anythings wrong now (more just a strain) but it did make me think about making sure you have your coding environment setup correctly and taking little breaks is probibly something that everyone (yes – including the hardcore coders) should do. I found one of those little mouse wrist rests from 3M seem to be pretty good (annoying at first – but really good on your arm). I dont know too much about it but its really worth the time to do a bit of a google search and find out what you should be doing to make sure you can code until the bitter end – dont want to have to call it quits early! Oh – and the stretches – do them gently – they arent supposed to hurt – can’t listen to what everyone tells you first off 😛

Profiling

March 4, 2006

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.