The S&P 500 is a diversified index that tracks 500 of the largest companies from every market sector, making it a good barometer for the broader U.S. stock market. By contrast, the Nasdaq Composite includes over 2,500 companies, with a focus on high-growth stocks in the technology and consumer discretionary sectors.

So what? The S&P 500 returned 886% over the last three decades, while the Nasdaq Composite returned 1,800%. The lesson there is simple: Investors that want to beat the market (and build life-changing wealth) should own at least a few growth stocks. Indeed, Wall Street legend Peter Lynch once wrote, "The very best way to make money in a market is in a small growth company that has been profitable for a couple of years and simply goes on growing."

Here are two growth stocks that fit the spirit of that strategy.

1. The Trade Desk

The Trade Desk (TTD 1.67%) runs the largest independent demand-side platform (DSP) in the ad tech space. Its software leans on what management calls "industry-leading" artificial intelligence (AI) to help advertisers plan, measure, and optimize data-driven campaigns across digital channels. But the most important thing investors should know is that, despite competing with larger ad tech companies like Alphabet and Meta Platforms, The Trade Desk is gaining market share.

Why? Some credit goes to superior technology. Consultancy Quadrant Knowledge Solutions recently recognized The Trade Desk as the best ad tech platform on the market, citing greater technological excellence and a more profound customer impact than any other vendor. But The Trade Desk has also distinguished itself through transparency. As an independent, buy-side-focused business -- meaning it owns neither web properties nor ad inventory, and it works only with ad buyers -- The Trade Desk avoids the conflicts of interest inherent to Alphabet and Meta.

Specifically, Alphabet and Meta provide ad tech tools to ad buyers and sellers, and they sell their own inventory from web properties like Google Search and Facebook alongside inventory from third-party publishers. That strategy lends itself to mistrust. Neither ad buyers nor ad sellers can ever be completely confident that Alphabet and Meta have their best interests at heart, just like a homebuyer would have reservations about working with a realtor that also represents the seller.

The Trade Desk continued to capitalize on its transparency in the second quarter. Revenue rose 23% year over year to $464 million, and GAAP net income improved to $33 million, up from a loss of $19 million in the year-ago period. That growth is particularly impressive in context: Alphabet and Meta reported second-quarter ad revenue growth of just 3% and 12%, respectively, meaning The Trade Desk gained market share.

Also noteworthy, The Trade Desk kept its customer retention rate above 95% in the second quarter, a level the company has now maintained for more than nine years. That metric shows in no uncertain terms that its ad tech platform creates value for advertisers, and that bodes well for the future. The ad tech market is expected to expand at 14% annually through the end of the decade, but The Trade Desk's technological expertise and transparency should allow it to grow even faster.

Shares currently trade at a pricey 21 times sales, but that valuation is a discount to the three-year average of 30 times sales, and it's a reasonable price to pay for a quality growth stock like The Trade Desk.

2. MercadoLibre

MercadoLibre (MELI 3.09%) runs the largest online commerce and payments ecosystem in Latin America. Its e-commerce marketplace receives nearly four times more visitors than the next closest digital shopping destination, and it accounted for nearly 21% of online retail sales in the region last year. That success is built on brand authority as MercadoLibre popularized e-commerce in Latin America, and its first-mover status has allowed the company to build trust with buyers and sellers. The company has leveraged that strength to build a broad portfolio of adjacent services.

Specifically, MercadoLibre has fortified its e-commerce leadership by providing merchants with solutions for payment processing, digital advertising, and logistics, all of which make its marketplace a more attractive option. MercadoLibre has also drawn consumers into its fintech ecosystem with small loans, credit cards, and digital wallet services. In fact, its subsidiary Mercado Pago is the third-most popular digital wallet in Latin America.

Turning to financial performance, MercadoLibre delivered an excellent second-quarter report. On the top line, revenue rose 31% year over year to $3.4 billion, driven by growth of 38% and 24% in the commerce and fintech segments, respectively. On the bottom line, GAAP net income soared 112% to $5.16 per diluted share as its profit margin expanded nearly 300 basis points due to more stringent lending policies and broader cost control efforts. That margin expansion is particularly impressive in context: Foreign exchange rates were a 300 basis point headwind to net income, meaning its profit margin would have expanded 600 basis points in the absence of unfavorable exchange rates.

Looking ahead, MercadoLibre has solid prospects for future growth. Latin America is home to a rapidly expanding digital economy. According to Statista, online retail sales and digital payment volume across relevant geographies are expected to grow at an annualized 14% and 15%, respectively, through 2027. But MercadoLibre should grow much more quickly given its status as the most popular online marketplace in the region.

Currently, shares trade at 5 times sales, a discount to the three-year average of nearly 11 times sales and a very reasonable price to pay for this growth stock.