On March 16, Susquehanna analyst Christopher Rolland projected optimism for the tech market by announcing: "We believe the acute portion of the semiconductor downcycle for the handset, PC, and consumer end markets has passed." Multiple stocks subsequently began trending upward as investors grew bullish at the prospect the battered tech market could start recovering after a challenging 2022.

As a result, leading tech giants like Apple (AAPL 0.64%) and Advanced Micro Devices (AMD 2.44%) are increasingly compelling investments. These companies have proven their worth as strong growth stocks in the past and likely have a lot to offer over the long term.

So, is Apple or AMD's stock the better buy? Let's take a closer look.

Apple is outperforming the market

Apple's stock is one of the most reliable investments available, thanks to its constant growth and proven ability to outperform the market. In 2022, macroeconomic headwinds led the Nasdaq Composite index to plunge 33% throughout the year. However, Apple experienced a more moderate fall of 26.8% over the cumbersome 12 months. Additionally, the same index has risen 13.3% year to date, while Apple's stock has increased by 22.6% in the same period.

As seen in the chart below, Apple's stock performance in 2022 wasn't easily achieved by its peers, with the company the only one among some of its biggest competitors to outperform the Nasdaq Composite. 

Chart showing Apple's stock price beating the Nasdaq Composite's in 2022, while several other tech companies didn't.

Data by YCharts

Moreover, Apple's reputation for consistent gains has safeguarded its stock against unexpected quarterly results. For instance, in the first quarter of 2023, the company reported a 5% year-over-year decline in revenue of $117.15 billion, its first revenue decline since 2019.  Such a stumble might result in substantial stock losses for many companies. But Apple shares rose 2.4% in the 24 hours after posting its quarterly results, as Wall Street illustrated its confidence in its long-term outlook.

In 2023, Apple reportedly has several exciting developments planned: A new mixed-reality headset, an iPhone with a USB-C charging port, and possibly the highly anticipated larger Apple Silicon iMac. Alongside a history of consistent growth, Apple's stock is a no-brainer buy right now.

AMD has strength in data centers and embedded products

In 2022, worldwide PC shipments declined by 16.2%, according to research from Gartner. As a leader in PC components, AMD's stock fell nearly 55% over the year. Meanwhile, its PC-focused client segment reported a 10% year-over-year reduction in revenue of $6.2 billion in fiscal 2022. 

However, the company proved its strength through its booming data center and embedded segments. AMD's data center revenue climbed 64% year over year to $6.04 billion, with its embedded revenue soaring 1,750% to $4.6 billion.

Data centers have become an immensely lucrative business for AMD. The company's hardware, such as graphic processing units (GPUs) and processors, powers data centers worldwide, hosting cloud platforms like Amazon Web Services and Microsoft's Azure. Considering the cloud market is projected to expand at a compound annual growth rate of 14.1% through 2030, AMD will likely continue profiting from the market's growth for years.

Additionally, AMD demonstrates growth in its embedded segment thanks to its 2022 acquisition of Xilinx. Xilinx is a company focused on developing specialized processors for various industries, from aerospace and defense to space exploration and artificial intelligence.

Apple and AMD each have a lot to offer as long-term investments. However, Apple's forward price-to-earnings (P/E) ratio of 26.6 compared to AMD's 31.5 proves the iPhone company is currently trading at a better value. Furthermore, Apple's more moderate stock decline amid economic challenges in 2022 suggest its business is more resilient and reliable for now. As a result, Apple's stock is currently the better buy. But a plan to also invest in AMD in the near future is not a bad idea, thanks to its potential growth in the coming years.