Shares of semiconductor specialists NVIDIA (NVDA 3.65%) and Micron Technology (MU 3.06%) have logged identical gains on the stock market in the past six months thanks to a string of impressive earnings performances, product development moves, and favorable market dynamics. As it turns out, both stocks have outperformed the NASDAQ-100 Technology Sector Index by huge margins in recent quarters.

MU Chart

MU data by YCharts.

But can NVIDIA and Micron sustain their terrific run, or should investors consider switching one stock for the other based on the valuation and potential catalysts?

The case for NVIDIA

NVIDIA's latest quarterly report suggests that the company isn't going to run out of steam anytime soon. The graphics specialist's revenue soared 48% year over year, thanks to almost 50% growth in its bread-and-butter gaming business, which makes up the majority of its top line.

What's remarkable is that NVIDIA's gaming business grew rapidly in a seasonally weak quarter, setting the stage for a stronger second half this year, as its new products start gaining more traction. For instance, NVIDIA's latest flagship GPU (graphics processing unit) -- the GTX 1080 Ti -- went on sale in March, followed by the more powerful Titan Xp in April, so the chipmaker has yet to record the full impact of these products.

Image of NVIDIA's GTX 1080 graphics card.

Image Source: NVIDIA. 

More importantly, the second half of the year should be a stronger one for GPU sales, as gamers have pushed back upgrades in anticipation of new products from NVIDIA and its rival AMD. Now that both graphics chipmakers have revealed their 2017 lineups, we can expect gamers to start buying GPUs once again.

Furthermore, the second half of the year is traditionally strong for GPU sales, and NVIDIA can ride the market's secular growth, as it controls over 70% of the discrete GPU market. Sales in this market are expected to increase to $84 billion in 2022, compared to $74 billion last year, per a research report from Markets and Markets.

But the PC market is just one of the many avenues that NVIDIA is pursuing. The company is witnessing solid traction in the data center market where its revenue almost tripled year over year in the first quarter.

Investors can expect the momentum in NVIDIA's data center business to continue, thanks to the growing integration of artificial intelligence and deep learning into data center servers in order to handle large data volumes and complexity in a fast manner. 

The case for Micron

Memory specialist Micron Technology's top line is growing at a terrific pace, thanks to a massive bump in NAND and DRAM pricing and volumes. In fact, a 21% jump in the DRAM average selling price, along with an 18% bump in NAND sales, boosted the company's revenue by 58% in the second quarter. 

More importantly, Micron's terrific financial growth isn't going to go away anytime soon as its third quarter revenue guidance indicates an 86% year-over-year jump at the mid-point. Investors shouldn't be surprised at such a sunny outlook as the memory market's demand-supply dynamics will remain favorable.   

Frank Huang, the CEO of one of Taiwan's largest DRAM makers, believes that DRAM demand growth will outpace supply this year, which should lead to better pricing. Also, research firm IC Insights forecasts that DRAM sales will jump 39% in 2017, along with a 25% increase in NAND flash sales, boosting average selling prices by 37% and 22%, respectively, in 2017. This should give Micron's earnings a solid boost this year but could pose a challenge as more memory manufacturing capacity comes online.

This should give Micron's earnings a solid boost this year but could pose a challenge as more memory manufacturing capacity comes online.

For instance, Chinese chip manufacturer Tsinghua Unigroup is going to spend $30 billion on DRAM and NAND facilities, while Micron rival SK Hynix will invest $5 billion to strengthen output over the next three years. Once these facilities come online, Micron runs the risk of losing the price advantage that it has enjoyed so far.

However, Micron investors can take heart from the fact that the company is aggressively moving to the 18nm manufacturing node, which can help it cut DRAM production costs by 20% per GB, according to Susquehanna.

The better bet

NVIDIA is a leader in its industry, so it can dictate the pricing of its GPUs. Micron doesn't enjoy the same luxury, as there are bigger players in the DRAM market, such as Samsung and SK Hynix, which have a combined market share of over 74%. Therefore, Micron's destiny is not entirely in its own hands, as it might not be able to take advantage of a potential increase in memory demand if prices start collapsing.

Not surprisingly, Yahoo! Finance analysts aren't too upbeat regarding Micron's bottom-line performance, forecasting just 1% annual earnings growth over the next five years. NVIDIA's prospects are stronger, as its bottom line could grow at 12% a year over the same period, making it a better long-term bet, as both stocks trade at an identical trailing price-to-earnings multiple.