Krispy Kreme Doughnuts (© Najlah Feanny, Corbis)

Back when the dot-com sector was collapsing in 2001, Krispy Kreme (KKD) was going in the opposite direction.

The stock took off from its 2000 IPO and split twice in 2001, hitting a high in 2003 of nearly $50 before traders woke up. By late 2005 the stock was trading for less than $5 a share, and during the 2008 crash it traded quietly in the $2 to $3 range.

Now it's back on the roller coaster.

After rising to more than $25 early last month, the stock has fallen to less than $20, after the company reported earnings that, while good, were below expectations because of one-time charges.

Those charges, a $1.7 million sale of leases and a $1.5 million lease termination agreement, involve a dispute with the former landlord at its commissary in Lorton, Va. But they went straight to the bottom line, turning an adjusted net income of $11.2 million, or 16 cents a share, into reported net income of $6.8 million, or 9 cents a share.

What all this proves is that Krispy Kreme is, once again, a momentum stock. Even at its current price you're talking about a price-to-earnings ratio of 61. Those doughnuts may be puffy, but I want some real cloud technology at that price.

Back during the last bubble, there was an assumption that Krispy Kreme could take its fried yeast doughnuts global, and that Japanese in particular might love a hot, fried, sugar-coated pillow as much as folks in Atlanta do.

Now the story is more of a domestic one, involving a franchise that remains weak in some states, such as New Jersey, Ohio, Pennsylvania and West Virginia, where it should have room to grow, and a packaged goods business that brings both its doughnuts and coffee into many grocery stores. (Full disclosure: I bribe my son into unpacking the car from Costco (COST) runs by hiding a box of Krispy Kremes in the trunk.)

Krispy Kreme's cake doughnut competitor, Dunkin Brands (DNKN), has also done well for investors over the last five years, but its gains are only one-tenth those of Krispy Kreme. Dunkin Brands' market cap is also four times larger, at $5.17 billion.

Krispy Kreme, by contrast, has a market cap of $1.29 billion, which means that in "normal times," such as 2010, it can easily get down to $400 million.

What brought back the froth was a stellar 2012, based on tax rebates that turned $30.36 million in annual earnings before taxes into $166.27 million in after-tax earnings.

The mania reminds me of the recent run-up in Bitcoin. Small floats in anything can lead to rampant speculation, as many people just can't resist a trend.

What busts a boom may actually be what sounds like good news for the underlying asset. For the three months ending in early November Krispy Kreme actually did pretty well, and there's more good news to come.

Krispy Kreme is re-entering the lucrative Houston market through a franchisee that has made a success in Dallas and is expanding rapidly there as well. Its coffee, including prepackaged coffee sold in warehouse stores and espresso sold in its shops, is also doing well.

All of which might make the stock a real buy, if it were currently priced at around $7. At that price you're looking at a P/E of about 20, for a company with decent growth prospects, a good handle on operations, and minimal financial risk thanks to its franchising business model.

But at $20? That's a different proposition, one that only speculators depending on "greater fool" psychology should be playing. As even my son has learned, the "hangover" from a half-dozen Krispy Kremes can leave your digestive system feeling mighty low.

At the time of publication the author owned shares of COST.

Click here to become a fan of MSN Money on Facebook

More from TheStreet: