Tuesday 18 October 2011

Why is my application slow?

I've used plenty of CPU / GPU profiling solutions on various platforms before, so when it finally became time to profile a win32 app I had written I looked around for a decent method.
This turned out to be surprisingly hard! Nothing decent was built into Visual Studio professional. I don't have the Team edition, so I cannot comment there, although why such a fundamental thing as a profiler is not present by default is a mystery.
Sure, I could go old skool and fill my code with clock checking around suspect functions, but surely there's a faster way.

VTune - this I just did not get on with. Pricey too. Had to system restore in the end to get my system back up.

AMD CodeAnalyst - promising, but not there yet.

Windows performance analysis tools (Xperf) - I'm happy in a command line environment, but this just got too fiddly.

Very Sleepy - Within one minute of download I had all the bottlenecks in my application in front of me.. even with call stacks. HURRAH!!

...so a mega thumbs up to http://www.codersnotes.com/sleepy
Free too!

and another.. also shows source line. A bit more techy, but still free!
http://lukestackwalker.sourceforge.net/


Monday 21 March 2011

Windows XP - Cant open applications? Window elements missing?

I've been using XP for years, usually doing 10 things at once, and therefore having plenty of windows open. Eventually I'll open an explorer window and it will look malformed, or I'll run an application and it will start acting very strange.
The solution I've had to employ is to close down some of the lesser-needed windows and then try again, usually with success. It's as if there's a memory leak, but there's no sign of any lack of free memory.
This mystery plagued me for so long until I eventually found the cause and a fix.. An internal memory heap needed to be expanded to accommodate all these windows!

It involves a registry tweak and a reboot, but microsoft have provided a foolproof fix to run, which I used and it's finally removed the only problem I've had with XP. Wish I had found it years ago.. argh!
http://support.microsoft.com/kb/126962 (Scroll down and click on "Fix It")

Install, reboot, open all the windows you want without fear of hitting any hidden limits. (well, eventually maybe!)