Last year was pretty hard on the Buffalo Portfolio.

While the stock market was churning out solid gains despite myriad economic and political worries, the Buffalo Portfolio simply sputtered throughout 2012.

A portfolio that owned a single share in each of the Buffalo Niagara region’s 21 publicly traded stocks would have gained just 5 percent last year, only a little better than a third of the 13.4 percent gain by the benchmark Standard & Poor’s 500 index.

It was the second straight year that the local stocks haven’t kept pace with the S&P 500 and the third-weakest performance by the Buffalo Portfolio over the past decade.

It also was a year of marked contrasts within the Buffalo Portfolio. Nearly one of every four local stocks enjoyed outstanding years, jumping by 29 percent or more, led by the 46 percent surge in the shares of Amherst self-storage facility operator Sovran Self Storage.

But nearly one of every five members of the portfolio had terrible years, losing a quarter of their value – or more – during the past 12 months, led by the 52 percent plunge in the value of Cleveland BioLabs shares.

Those wide swings are why the overall Buffalo Portfolio failed to gain much traction during the course of the year. Only a little more than half of the portfolio’s members – 11 out of 21 – went up during 2012 and only a third of the companies managed to beat the S&P 500. A little less than half – 10 out of 21 – went down.

The local stocks didn’t show nearly as much strength and resilience as the broader market, which shook off a wide range of concerns – from fears about a eurozone breakup and the long-simmering European fiscal crisis to worries about the Chinese economy and stubbornly high unemployment in the United States.

Bold investors didn’t let those fears hold them back, and they were rewarded for their courage, said Bruce Kaz, the president of Courier Capital Corp., a Buffalo money management firm.

But that wasn’t an easy path to follow, especially since many economists regularly raised the possibility that the global economy might be on the verge of slipping back into recession again and the U.S. economy remained lackluster, expanding by around 2 percent, which is only about half the rate economists said is needed to put a meaningful dent in unemployment.

“The market has behaved beautifully since May,” said Tim Johnston, the managing partner at Sandhill Investment Management, a Buffalo money management firm.

“Corporate America continues to operate very well,” Johnston said. “Business has a healthy, but unspectacular, tone.”

No local company had a healthier 2012 than Sovran Self Storage. The Amherst company, which operates 443 self storage facilities in 25 states under the Uncle Bob’s brand name, has been revamping its portfolio of stores, selling some in mature markets while expanding its presence in others. It now has 75 more stores than it had at the end of 2010.

The company also has been working steadily to control its costs and boost its efficiency through investments in technology, including a 41-person call center in Amherst that allows Sovran to tailor its pricing to the demand for specific types of storage units in a particular neighborhood.

“These are modern, state of the art facilities in high density markets, and we continue to look to add such properties to our base,” said David Rogers, Sovran’s chief executive officer.

Sovran also spends more than $5 million on Internet advertising “to make sure potential customers can find us on their computer, their tablet or their smartphone,” Rogers said. “Our stores are easily found by potential customers searching the Web because we place high on the search listings.”

“We’re the fourth-largest operator of self-storage facilities in a very fragmented industry,” Rogers said. “We can afford to do this whereas 90 percent of our competitors can’t.”

As a result, Sovran’s earnings jumped by 29 percent during the first three quarters of last year. Revenues from stores open at least a year were expected to rise by about 6 percent for all of 2012.

Sovran’s 46 percent gain far outpaced the 30 percent jumps by the second- and third-best performing members of the Buffalo Portfolio – Amherst material handling equipment maker Columbus McKinnon Corp. and Evans Bancorp.

Columbus McKinnon, which was the third-worst performing member of the Buffalo Portfolio during 2011, barely beat out the parent company of Evans Bank for second-place bragging rights last year, largely on the back of its strengthening profits, which surged by 77 percent during the first half of the current fiscal year.

Columbus McKinnon executives said the improved profits were due to a combination of a shrinking tax bill, modestly stronger sales, price increases and improved productivity. Timothy T. Tevens, Columbus McKinnon’s chief executive, said he continues to see strong growth from the company’s markets in emerging economies, especially in Asia and Latin America.

Like Columbus McKinnon, higher profits were the driving force behind Evans Bancorp’s 30 percent surge last year. The bank’s profits improved by at least 11 percent during each of the first three quarters of 2012 as its loan portfolio expanded by about 6 percent over the past year.

The quality of those loans also improved, allowing the bank to reduce the amount of money it sets aside for bad loans. At the same time, Evans’ deposit base expanded by almost 10 percent over the past year as the bank has slowly expanded its network of branches to 14.

Not far behind Evans was Computer Task Group, the Buffalo-based information technology company that has been riding a wave of investment in electronic medical records projects.

CTG’s shares jumped by 29 percent, nearly in lock-step with the 31 percent surge in its profits during the first three quarters of last year. While CTG’s revenues grew by just 7 percent during the first three quarters, its profits expanded much more rapidly because its fast-growing health care business and other portions of its technology solutions practice are more lucrative than its staffing operations.

On the downside, Cleveland BioLabs was the Buffalo Portfolio’s weakest member for the second year in a row, as the Buffalo-based drug development company continued to scramble to line up the funding it needs to complete crucial studies on its anti-radiation sickness drug and bring it to market. Cleveland BioLabs shares, which tumbled by 60 percent in 2011, lost another 53 percent last year.

Ecology & Environment’s shares slid by 31 percent as the Lancaster-based environmental services firm’s profits steadily eroded during the course of 2012, culminating in a nearly $1 million loss during the summer quarter caused by a steep drop in work on energy-related projects.

Astronics Corp. which had been the leader of the Buffalo Portfolio in both 2010 and 2011, ran into some turbulence last year, with the East Aurora aircraft lighting and electronics manufacturer’s shares sliding by 25 percent. Much of the decline came after Astronics surprised analysts with a 26 percent drop in its third-quarter profits, caused by higher engineering and development costs, coupled with an increase in warranty and inventory costs.