I am now a 50 year old manager of a small piece of a very large company that purchased us about 1 year ago. Been into computers since grade school in the late 70's, having spent years working in the field, building, fixing, installing, selling, teaching, gaming, programming and now consulting on all the aforementioned topics. Computing life is good.

Tuesday, April 17, 2007

The Developers Toolbox...

The developer’s toolbox, like any professional’s tool collection is best when it’s bristling with implements that augment a workers talent, and when applied by a knowledgeable person seemingly allow miracles. As a developer I have a great number of such tools in my toolbox. Some of which I have developed myself. Others I have purchased from the market. One of the most valuable such tool is a product that I purchased from a company called Red Gate (http://www.red-gate.com). Its name is the ANTS Profiler.

The Ants Profiler (here to fore called ANTS), is a .NET application performance/resource consumption profiler that allows the .Net developer to meter the performance and memory consumption characteristics of their .Net applications. It will allow the profiling of .Net 1.1 and 2.0 applications and in its current version (3.0.0.342) integrates directly into the VS2003 and VS2005 environments from the drop down menus within the IDE itself( this is new in version 3+ and makes the software easier to use). I have used the application as it exists now on every version of windows since 2000 and I am currently running it on my Vista Ultimate development machine. Having used the product for a number of years now I have found it to be so useful that I can not fathom living without it.

Using the application to conduct a performance profile of a running .Net application is about as easy as it gets, basically breaking down in 4 steps…

  1. Compile the application in Debug mode so it generates a .PDB file as well as the executable.
  2. Open the Ants Profiler interface and point it at the executable file you want to profile.
  3. Select a few options (like profile just what you have source for or all .Net methods, and what command line parameters you might want to pass along to the running application).
  4. Run the app through the paces you want to profile.

When you have completed and exited the application, the Ants profiler will display three different groupings of performance characteristics.

  • Slowest Lines of Code
  • Slowest Methods
  • Slowest Methods with Children
    (note) these lists are top 10 and can be expanded to show each category in their entirety

A window at the bottom of the display will show the actual code for the application for the items selected from the top three sections. Click on a slow line of code and ANTS will pop to that line in the bottom window. It will show you the source file where the line is located, what line number it is, how many times the line executed, and finally how long the system spent executing that line of code. Using the navigation tools that ANTS provides, allows the developer to easily pinpoint trouble areas in their application, areas in need of modification to bring performance up to desired levels. ANTS, excels at showing the developer where in the code the bottlenecks are located. It’s up to the developer to determine how to fix the problem however, ANTS provides you with all the necessary information.

ANTS also allows you to save the results of any profiler run off to a file. You can then tweak your code and re-profile the application comparing the results on the second profiler run with the results of the first. This back and forth between the IDE to craft a tweak and ANTS to gauge the tweaks effectiveness is fluid and natural feeling and greatly enhances the tools usability. Few things in a coders experience are as satisfying as seeing a slow method fall off the top 10 list in the ANTS results after a tuning session with ANTS. Something just seems right with the limited world of a coder and ANTS delivers the goods.

An actual example where I used the profiler results to fix a performance issue showed me that a particular set of code lines were executing in a custom file importer we had written for a set of clients. In this case these lines needed to be run through once for each line of text file being parsed. In this case there were 12 elements on each of these lines that needed to be parsed as dates. ANTS showed that while the methods attached to the DateTime class were real handy for ensuring the integrity of data being passed through them, their performance was underwhelming. Multiply this sluggishness by the millions of times they were being invoked, and you get the idea. Using ANTS I was able to see this clearly and found that I could write my own validation using simple string manipulation to create the same functionality I needed while boosting performance considerably. (In this case an 80% reduction in execution time of these snippets of code). The importer was then able to process its file in 30 minutes rather than 4-5 hours.

Another particular instance showed that our own Grid control that we had written many moons ago suffered from a particularly bad design, (My fault of course as I developed the thing for our company). ANTS allowed me to see that I was being incredibly wasteful in the instancing of objects to hold the individual cells of the grids data, each cells formatting characteristics, Fonts, Colors, and other state information. ANTS showed the error of my ways to me and allowed me to rethink the way the grid itself was architected. Now our Grid control is used in everything we write and it runs like greased lightening even with millions of cells of data housed within.

Performance gains like those above have been enjoyed by my development team and I, on more than a couple of occasions. So enamored am I with the tools ability to show problems in execution pathways that I use ANTS to test the performance of every application I write and reuse it on any application I perform any significant rework or enhancement to. For your performance gauging needs on any of your .Net application under development ANTS has proven to us to be an invaluable tool for the job. Reasonably priced, easy to use, I would not hesitate to recommend it to anybody with the need for .NET speed.

Wednesday, April 11, 2007

Finding good people

We are in a growth spurt here at my place of employment. This is usually a good thing for a company, showing that the future is bright and that the mistakes of the past have not proven fatal to that future. This would be good except for the fact that there is a dearth of qualified folks seeking employment. Small companies like ours have a very difficult time finding people to fill roles within the company. Small companies have a difficult time competing for the limited number of qualified people with the larger firms in the market. Small firms cannot compete on salary's and other benefits with the bigger companies. So when a small firm places an advertisement for a position, they often get a few applicants none of which are really suited for the position at least on the paper. The end result is that small firms have to contend for the scraps at the employment dinner table. Fighting with the other smaller firms for remaining candidates.

Another item that affects all firms but especially hurts smaller firms is the constant contact that employees have from outside hiring forces. I would never seek to restrict a persons basic right to better themselves or their situation in life, but given that smaller firms have a difficult time replacing members of their workforce, it becomes especially painful when you have a member leave for greener pastures. Lured away by a head hunter. While I personally have experienced a perverse sort of buyers remorse after leaving a prior place of employment. I can say that sometimes the grass may be greener on the other side of that fence.

Traditionally working for a smaller company had benefits that transcended simple salary and other tangible benefits. That feeling of belonging, or being important in an endeavor that is important, or perhaps the feeling of freedom with a flexible work schedule. The problem is that as pressures on a smaller firm mount and that firm has fewer and fewer qualified candidates for positions, these previous advantages evaporate, as the firm struggles to maintain itself. Things like flexible work schedule are often enough the first things to go from a small firm. Small firms also always seem to have that sword hanging over their heads, twisting slowly in the winds of change that blow constantly in todays market place. With moral often enough taking the hit. The Firm finds itself in a position where it is losing its one ace that might attract a qualified person to a position and keep them there over the long haul.

In the end a small firm is faced with many challenges, perhaps the most important being the search for a way to grow without growing up and growing old. The challenge to a small firm is finding a way maintain its small set of attraction items in the face of these challenges, and continue to grow in spite of them.