Saturday, January 30, 2010

GC patched ruby for performance testing

The Guide for Rails performance testing has instructions for patching ruby to provide garbage collection statistics. The only problem is, the patch is against a ruby version that is 2 and a half years old and doesn't compile by default on my machine.

The patch doesn't apply cleanly against the latest ruby 1.8.7 (p249). I found a version of the patch on github and fixed it up to apply to 1.8.7. Here is my fixed up copy.

I downloaded ruby from here and applied my updated patch with "patch -p1" and it compiled fine and doesn't seem to have any problems. Of course this version of ruby is only for profiling.

Updated Feb 2, 2010
Sorry to disappoint, but when I finished the patching the rails performance tests still wouldn't give me memory metrics. Back to the drawing board. I'll update this when I get a better patch.

Friday, January 29, 2010

Autotest just keeps getting better

Right now I'm working with a ruby on rails project that has lots of test and they take quite a while to run. I'm also doing more testing than I have on previous projects, so I'm running the tests frequently.

Obviously I'm using autotest, but I just found out about the "-c" and "-f" switches. "-c" makes autotest run run the full regression tests each time the tests all pass. "-f" makes autotest not run all the tests are startup.

As I was playing around with autotest, I found easy instructions on how to setup notifications for autotest in linux. I figured I'd copy the code and see what it is like. Wow! I really like it. When I finish changes, I just keep on going and the notification lets me know when the tests are done running and what the out come was. It really helps me focus on what I am doing and helps me stay in the "groove" better.

Thursday, January 28, 2010

When computers aren't enough

A friend forwarded this to me today and I couldn't stop laughing:

A cowboy named Bud was overseeing his herd in a remote mountainous pasture in California when suddenly a brand-new BMW advanced toward him out of a cloud of dust.

The driver, a young man in a Brioni suit,Gucci shoes, RayBan sunglasses and YSL tie, leaned out the window and asked the cowboy, "If I tell you exactly how many cows and calves you have in your herd, will you give me a calf?"

Bud looks at the man, obviously a yuppie, then looks at his peacefully grazing herd and calmly answers, "Sure, Why not?"
The yuppie parks his car, whips out his Dell notebook computer, connects it to his Cingular RAZR V3 cell phone, and surfs to a NASA page on the Internet, where he calls up a GPS satellite to get an exact fix on his location which he then feeds to another NASA satellite that scans the area in an ultra-high-resolution photo.
The young man then opens the digital photo in Adobe Photoshop and exports it to an image processing facility in Hamburg , Germany .
Within seconds, he receives an email on his Palm Pilot that the image has been processed and the data stored. He then accesses an MS-SQL database through an ODBC connected Excel spreadsheet with email on his Blackberry and, after a few minutes, receives a response.

Finally, he prints out a full-color, 150-page report on his hi-tech, miniaturized HP LaserJet printer, turns to the cowboy and says, "You have exactly 1,586 cows and calves."
"That's right. Well, I guess you can take one of my calves," says Bud.

He watches the young man select one of the animals and looks on with amusement as the young man stuffs it into the trunk of his car.

Then Bud says to the young man, "Hey, if I can tell you exactly what your business is, will you give me back my calf?"
The young man thinks about it for a second and then says, "Okay, why not?"

"You're a Congressman for the U.S. Government", says Bud.
"Wow! That's correct," says the yuppie, "but how did you guess that?"

"No guessing required." answered the cowboy. "You showed up here even though nobody called you; you want to get paid for an answer I already knew, to a question I never asked. You used millions of dollars’ worth of equipment trying to show me how much smarter than me you are; and

You don't know a thing about how working people make a living - or about cows, for that matter. This is a herd of sheep. ....
Now give me back my dog.