As the U.S. economy slows, small businesses are still hiring at a breakneck pace -- even as they temper plans to invest in the future.  

A survey from the National Federation of Independent Business showed that the percentage of small firms planning to expand employment climbed to 23% in December from 22% a month earlier. The latest reading, while down from a record 26% in August, is still at roughly the level charted in late 1999, when the U.S. economy was thriving amid the dot-com boom.    

Yet the percentage of small firms with plans for capital spending -- investments on things like new plants, equipment and technology -- fell in December to 25% from 29% a month earlier. That's basically what happened in early 2008, when signs emerged of the looming subprime-mortgage crisis -- just as the economy was entering its last recession. Within the year, the U.S. financial system nearly went bankrupt and stock prices plunged by the most in 71 years.

It's a reflection of the schizophrenia of President Donald Trump's economy, where data showing that hiring remains robust, and workers increasingly scarce, comes as more Wall Street analysts fret that growth might be slowing. The nervousness, due partly to concerns that the president's tariffs on Chinese imports might damage both countries' economies, has contributed to a 6.4% decline in the Standard & Poor's 500 Index of U.S. stocks over the past year. 

Yet companies are still hiring at a rapid pace, even as qualified workers become tougher to find; the unemployment rate is 3.9%, close to the lowest in a half-century. A report last week from the Labor Department showed that the economy added 312,000 jobs in December, among the highest readings in the past decade.     

Bill Dunkelberg, chief economist at the National Federation of Independent Business, says the hiring spree is likely a sign that business owners are currently witnessing robust sales, sufficient to justify adding more workers. The outlook, however, might be cloudy enough to warrant increased caution on major expansions.      

"If you think business conditions are going to be worse, you're less inclined to be making capital expenditures," Dunkelberg said in an interview. 

The U.S. economy is in its 10th year of expansion, approaching the longest on record, and Wall Street analysts still expect positive growth, albeit slowing, in the next three years. Indeed, the survey Tuesday showed that small businesses optimism remains at an elevated level, based on historical standards.  

Even so, market signals such as the recent decline in stocks and a shrinking gap between yields on short-term and long-term U.S. Treasury bonds -- often a harbinger of a recession -- have prompted some economists to become more pessimistic about the outlook.

The percentage of small U.S. firms expecting the economy the improve over the next six months fell to 16% in December, from 22% the prior month, according to the business federation's survey. In December 2016, just after Trump's election, the measure had shot up to 50% from 12% the prior month. 

One concern is that reduced spending by businesses could act as a further brake on the economy, especially with the stimulus fading from Trump's late-2017 tax cuts.  

Ian Shepherdson, chief economist at the forecasting firm, said in a note to clients that the latest survey might show that "the uncertainty engendered by the drop in stock prices appears to be seriously unnerving small-business owners."

He added: "The labor market numbers are very strong." 

What a party.