Few things are worse than buying a stock only to see it fall short of your expectations for years. But just because a stock goes nowhere for years on end doesn't mean that it won't finally start performing for you -- or start going up after you give up on it and sell.

The dead-stock conundrum
We're all familiar with the Lost Decade for stocks and the huge ups and downs the stock market has gone through over the past several years. But once you look past the short-term bumps and dips and focus on long-term performance, you'll see that many stocks have essentially treaded water for a very long time -- and some have maintained a slowly declining trajectory that have left long-term shareholders wondering what to do next.

Figuring out that next step is critical, though. As a recent article in SmartMoney noted, many large-cap stocks have seen earnings rebound sharply over the years, but share prices haven't followed suit. In such cases, it's tempting to conclude that the investing community has simply disconnected from the fundamentals of the stock, and trying to fight the tide will only result in more heartbreak.

But on the flip side, some stocks do find a catalyst to go higher even after years of lackluster performance. To counterbalance the idea that you should always just give up on flat performers, let's take a look at three stocks that have turned the tide in the past year.

A refined choice
HollyFrontier
(NYSE: HFC) had a rude awakening during the energy boom in 2007. Along with fellow refiner Valero (NYSE: VLO), Holly saw its shares skyrocket during the first wave of rising gasoline prices, which eventually breeched the $4 level. Yet even before the commodities bust, refiners topped out early, as the cost of obtaining crude oil at prices approaching $150 proved too costly even at the prices refined products fetched -- especially as demand fell. Holly's shares eventually lost about 85% of their value.

But in a masterstroke, Holly decided to merge with Frontier to create a powerhouse refining company. That has given the newly merged HollyFrontier a huge competitive advantage, and investors have rewarded it with a big move up in the company's share price even including the market's recent tumble -- while Valero now trades at levels fairly close to the stock's late-2008 lows.

Brewing up some prospects
In the coffee wars, Peet's Coffee & Tea (Nasdaq: PEET) looked like it would be the eventual loser. On one hand, Starbucks seemed to have a strong grip over most of the coffeehouse market. Competition from bargain-pricing brewers McDonald's (NYSE: MCD) and Dunkin' Brands (Nasdaq: DNKN) looked like it would threaten margins indefinitely, and Green Mountain Coffee Roasters (Nasdaq: GMCR) was attacking the market with its Keurig machines, allowing potential customers to bypass coffeehouses entirely.

But throughout the past several years, Peet's managed to survive, and since late 2009, the company's stock has jumped sharply. Takeover speculation is undoubtedly driving the share price to some extent, as Peet's former fight with Green Mountain over Diedrich Coffee showed the high value of companies in the space.

Just because Peet's stock has jumped doesn't prove its long-term value, though. The stock could just as easily come crashing down if the craze over coffee stocks finally runs its course. But for shareholders who believed the company could compete well in the space, they finally got their reward.

A clearer connection
For years, 8x8 (Nasdaq: EGHT) saw its shares trade in a fairly tight range as the voice-over-Internet-protocol provider tried to find a way to capitalize on a growing market. A 2005 deal with Bellsouth seemed promising but didn't move the needle for shareholders.

Recently, though, shares have skyrocketed. The catalyst has been the company's differentiating itself from mere VoIP to building itself into a one-stop cloud computing service aimed solely at businesses. With smart strategic acquisitions, 8x8 is in position to benefit immensely from any increase in business activity.

Alive and kicking
It's tough having stocks in your portfolio that seem to go nowhere. But before you dump them out of disgust, make sure you're comfortable that their prospects are truly gone. Otherwise, an eventual jump could leave you cursing your lack of patience.

One of the nice things about dividend stocks is that even when their stock prices go nowhere, you're still getting big income. These 13 high-yielding stocks make it a lot easier to be patient for growth.

Tune in every Monday and Wednesday for Dan's columns on retirement, investing, and personal finance. You can follow him on Twitter here.