Wednesday, February 23, 2005

Ode to Trace

I have a project I have been working on wrapping up. We have gotten tons of user feedback, which thrills me to know that my tool will get used. On my list of items needing attention, however, one item loomed largely. I ignored the item for as long as I could. I cleared up everything else, and I had no choice but to stare my arch-nemesis directly in the face: performance. "Yikes", I murmured to myself, trembling. There were so many controls on my page, there were so many domain object getting loaded, the task of finding the offending performance hog seemed to be a huge undertaking. I fretted, I greived, and then I pulled myself out of my self-pity mode and came up with a plan.

From the good old days of .net Beta, when stepping through code without running into environment hang ups was only a distant fantasy, I remember my friend, Trace. So I set Trace=True in my aspx file, and went to town adding Trace.Write lines to my code. I began to get excited as I awaited my first trace output. I could envision the lines I would see, tellling me the expanded time that each snippet of my code began and ended execution. Lo and behold, when I saw the first Trace output, my troubles were over. I saw the offending control was something leftover from pre-version one of my form. This slow control was loading up over 50 times. I slashed the control from my code, and my page now loads about 60 times faster. Hooray! I have defeated the performance tyrant. So, in appreciation of Trace's beautiful output, I have decided to write an Ode...

Ode to Trace

Before I used you, the performance of my page was a disgrace
Rather than troubleshoot, I would have preferred an eye full of mace
As my hour of deployment drew near, I was in a time-race
When, in a flash of brillance (okay, that may be arguable) I turned on Trace.

Seriously, maybe everyone else in the developement community is using Trace all of the time. I had forgotten about it, and I am SO GLAD I remembered to use it today :)


blameMike said...

Tracing has also saved my behind a number of times in the past.

Love the code poem by the way. :)

Valerie Vogt said...

Thanks :)

I know it was a dorky thing to write, but hey, I am a techie-geek so why not?

blameMike said...

What's that famous old aphorism?

Ah, yes...

The geek shall inherit the Earth.

Man am I corny sometimes? That's rhetorical by the way. ;)

Brian said...

Hey, you have a great blog here! I'm definitely going to bookmark you!

I have a email promotion and internet marketing automation site/blog. It pretty much covers email promotion and internet marketing automation related stuff.

Come and check it out if you get time :-)

Anonymous said...

Wow, I really like this one. I have a website that talks mostly about email marketing company You should check it out sometime.