STOCKS are the best investment for the long run. That is the common mantra among investment pundits. But the recent record high for the NASDAQ, America’s tech-heavy equity index, ought to give investors pause. Like the FTSE 100 in London, it has taken 15 years for the NASDAQ to surpass its previous high (see chart). Even so, that counts as a sprightly performance compared with Japan’s Nikkei 225, which still trades at only half its 1989 peak.

Such statistics make it hard to argue that “there are no such things as bubbles”, as the occasional economist still contends. A very high stockmarket valuation implies the expectation of rapid growth in future profits. The average price-earnings ratio of the NASDAQ back in 2000 was more than 150. In other words, if profits did not rise, a shareholder would have had to wait for well over a century to recoup his original investment.

Perhaps investors were thinking of their great-great-great-grandchildren, but that was not how it seemed at the time. Technology companies were expected to take over the world and drive “old economy” firms out of business; their profits would soar as a consequence. Some tech companies have indeed performed fantastically well, as Apple’s latest set of bumper profits show.

The problem in 1999-2000 was that everyone thought they were going to make money out of the internet. This prompted lots of bright graduates to set up their own dotcom company with a plan to exploit some niche. Such enthusiasm created its own demand for tech products: the new firms needed routers, desktops and access to fibre-optic cables. That boosted tech earnings for a while.

But it also meant that some sectors were extremely crowded and competitive. This made it more difficult for tech companies to make money. Earnings crashed after 2000, rather than rising as investors had anticipated. It was not until 2010 that the earnings per share at NASDAQ companies regained the level recorded back in 1997.

Faltering firms were bought up by their competitors; three-quarters of the companies that made up the NASDAQ at the end of 1999 are no longer listed. It is a familiar theme from history: the biggest profits do not always flow to the pioneers. Two of NASDAQ’s current giants, Google and Facebook, had not even gone public by 2000.

Another “rational” explanation for high stockmarket valuations is that investors are prepared to accept lower returns going forward, as values revert to the mean. But that is not what happened at the turn of the century. The NASDAQ rose by 86% in 1999 and investors piled in, hoping to get a piece of the action. They expected annual percentage gains in the double digits.

For a while, their enthusiasm bid share prices higher. But as soon as investors lost confidence, the losses were brutal.

This time around, valuations look much more reasonable. The price-earnings ratio is 26, and the market’s progress has been steadier, rather than exponential: the latest doubling in share prices has taken more than three years. Russ Koesterich, a strategist at BlackRock, a fund-management group, points out that tech stocks comprise only 20% of the overall American market by value, compared with 30% back in 2000.

Biotech is one sector where there are signs of overenthusiasm (up by more than 50% over the past 12 months), although this in part reflects the emergence of some genuinely promising new drugs. Andy Acker of Janus, another fund manager, cites the Sovaldi treatment for hepatitis C made by Gilead: sales in its first year were $10.3 billion, compared with consensus forecasts of $1 billion. Many of these drugs are specifically intended to replace expensive alternative treatments. This gives companies more predictable earnings. The maker of one such drug, Celgene, told investors that its earnings would increase by 23% a year all the way to 2020.

Of course, it is not hard to imagine a return of the bubble mentality. It may already have emerged in the world of start-ups and venture capital. A few more years of zero interest rates and negative bond yields, which force investors to seek higher returns from riskier assets like equities, and who knows what might happen.

But as yet, there is nothing like the sense of euphoria that marked out 1999-2000. Investors are not focused on financial news (CNBC’s 2014 ratings were the lowest since 1995); workers are not quitting their jobs to indulge in day trading. That is one good thing about living through a bubble: it is easier to spot the signs next time.