Taiwan Semiconductor (TSM  ) shares were 6% higher following the company's better-than-expected Q2 earnings, as the company reported record results in terms of sales and profits. It also issued better than expected guidance but warned that demand could slow due to a recession.

TSM is the world's largest chipmaker, and it counts the world's leading chip designers as its customers including Nvidia (NVDA  ) and AMD (AMD  ). For investors, TSM's results are particularly interesting, because they are seeing if the slowdown in the broader economy and consumer tech is also starting to impact enterprise tech spending.

So far, there are small signs of slowing, but nothing too dramatic as implied by the decline in prices. TSM is down about 42% from it's all-time high in January of this year. But, the decline has led to much more attractive valuations as it has a forward P/E of 13.4.

Inside the Numbers

In Q2, Taiwan Semiconductor reported $18.2 billion in revenue, a 44% increase from last year, and beat consensus expectations by 2%. It also topped estimates for net income with $9.1 billion, a 76% improvement from last year.

It also issued better than expected guidance for Q3 at around $20.3 billion, which is 37% better than last year. It also is another indication that while some parts of the economy are in a recession not all are.

It also noted some concerns about risks including inflation, issues with procuring semiconductor manufacturing equipment, recession, rising material costs, and the war between Russia and Ukraine.

However, investors differ on whether the results are indicative of TSM's moat or broader strength in the industry. There are also signs that chip inventories are quite high especially in consumer and PC markets, while demand remains strong from data centers and autos.

Overall, TSM's earnings results make clear that it's the 'best of breed' in the semiconductor industry as it's been insulated from a slowdown so far. And, its growth outlook remains strong looking into 2023 which means that its growth is likely to remain positive even through a brutal recession.