What a crazy year it's been for investors. The S&P 500 jumped more than 8% by May, only to turn around and find itself down more than 10% in August, mainly as a result of the European debt crisis and Washington's inability to agree on a solution to our debt dilemma. Now, at the end of December, the S&P has fought back and is poised to end the year essentially flat.

But while the markets as a whole didn't change much over the past 52 weeks, there were certainly companies that proved to be much more resilient and were able to post some impressive gains.

Here's a list of 2011's top 10 performers in the machinery industry.

Company

% Return in 2011

Westport Innovations (Nasdaq: WPRT) 82.2
Chart Industries (Nasdaq: GTLS) 61.1
Colfax Corp. (NYSE: CFX) 52.0
Robbins & Myers (NYSE: RBN) 33.6
Westinghouse Air Brake Technologies 28.5
Sauer-Danfoss (NYSE: SHS) 26.7
Lincoln Electric Holdings (Nasdaq: LECO) 18.3
Mueller Industries 16.3
Barnes Group 16.3
CLARCOR 15.4

Source: S&P Capital IQ. Only includes companies listed on U.S. exchanges that contain a market capitalization greater than $500 million. Returns as of Dec. 28, 2011.

These companies make all kinds of things, so they can be vulnerable to the overall state of the economy and to consumer and infrastructure spending. That's why it's even more impressive to see high returns from these companies for the year to date.

Leading the way for 2011 was Westport Innovations, and with good reason. The company saw its revenues from its joint venture with Cummins rise almost 60% in its past quarter. The company also finalized three big new initiatives this year. In June, Westport announced that it will be teaming with General Motors to develop advanced natural gas engine technology.

Not to be left out, the company also announced it will be working with Ford on a bi-fuel natural gas engine that will be available on Ford's larger trucks starting in 2012's second quarter. Finally, Westport is now teaming with equipment giant Caterpillar to develop heavy-duty engines.

Lincoln Electric Holdings, which rose 18% so far on the year, was able to beat analyst expectations for earnings per share all three quarters this year. Likewise for Robbins & Myers, which matched or beat EPS estimates for its three quarters, as well. We'll see whether the company can continue that streak when it reports earnings Jan. 6.

Just missing the list was Trinity Industries (NYSE: TRN), which rose 11.3% so far this year. The stock was pushed up early in the year after the company increased its quarterly dividend and issued full-year guidance above analyst estimates. Predictably, the company lost much of its value in late July and early August as debt worries pummeled the markets. But Trinity has rebounded nicely, and has gained more than 50% since the beginning of October.

All of these machinery companies had a solid 2011, but that's no guarantee of future success. If you're looking for strong outperformers in the year ahead, you're in luck. The Motley Fool has created a brand-new free report called "The Motley Fool's Top Stock for 2012." It highlights a company that our chief investment officer has singled out for explosive growth in 2012. You can get instant access to the name of this company by clicking here -- it's free.