Warren Buffett and Carl Icahn are arguably the two most successful investors of their generation. Both have compiled enviable performance records for more than half a century.

Since 2000, shares of their publicly traded investment vehicles -- Berkshire Hathaway (NYSE:BRK.A) (NYSE:BRK.B) and Icahn Enterprises (NASDAQ:IEP) -- have crushed the S&P 500's return. Any sane investor would be happy with either track record.

Nevertheless, Buffett's straightforward, patient investment philosophy represents a much better model for investors to try to mimic, rather than Icahn's fast-paced, high-stakes investing style. In particular, Warren Buffett differs from Carl Icahn in having a long-term mindset and a fundamentally optimistic outlook. These are two key traits that individual investors can, and should, try to internalize.

Examining the performance records

To begin to understand why investors should emulate Warren Buffett rather than Carl Icahn, let's compare their investment records.

At first, Icahn might seem to have the superior track record. After all, Icahn Enterprises stock has outperformed Berkshire Hathaway stock by nearly 200 percentage points since 2000.

However, Icahn Enterprises is structured as a partnership. This means it doesn't have to pay corporate taxes -- instead, shareholders must pay income tax on their share of the company's earnings. That can lead to hefty tax bills whenever Icahn Enterprises sells an asset for a big gain.

Moreover, it's not clear that Icahn's strategy has stood the test of time. Over the past decade, Icahn Enterprises shares have lost more than half of their value. During that same time, the S&P 500 has risen 64%, and Berkshire Hathaway's stock price has more than doubled. (More recently, Icahn's hedge fund has lost money for three years running, including declines of about 18% and 20% in 2015 and 2016, respectively.)

Furthermore, even if Icahn is just in a temporary slump, most investors can't afford the extreme volatility of his investment returns. Having less than half of your initial investment after a decade is not an acceptable outcome. Berkshire Hathaway stock has delivered much more consistent growth over time.

Lastly, Warren Buffett demolishes Icahn in terms of total wealth-creation. Berkshire Hathaway's market cap has expanded by roughly $340 billion since the beginning of 2000. That's about 50 times greater than the increase in Icahn Enterprises' market cap over that period. Simply put, Carl Icahn has been managing far less money than Buffett, which is a huge advantage in terms of posting big gains in percentage terms.

All in all, while Buffett and Icahn both have incredible investing track records when you consider the entirety of their careers, Buffett's performance is more impressive than Icahn's.

Slow and steady wins the race

From a high-level perspective, Buffett's strategy can be described as buying and holding great businesses with durable competitive advantages. By contrast, Icahn tries to make timely bets on out-of-favor companies that are ripe for a rebound. Let's take a look at two reasons why investors can expect better results from following a Buffett-like approach.

Icahn's investments in Netflix (NASDAQ:NFLX) and Apple (NASDAQ:AAPL) highlight one flaw in his investment process: short-term thinking. Carl Icahn isn't a day-trader, but he routinely dumps stocks within two or three years of buying them. Thus, even when he finds undervalued gems, he doesn't always fully capitalize on those opportunities.

For example, Icahn scooped up about 5.5 million shares of Netflix in 2012 at an average price of $58, just as the stock was bottoming out after falling from a high above $300 the year before. At the time, he thought the company was likely to be acquired soon.

No buyout offer materialized. Yet Netflix stock soared anyway as its move into original content began to drive strong growth for its streaming service. Icahn began selling his Netflix shares a little over a year later, by which point they had already more than quintupled in value. By mid-2015, he had closed the position entirely, booking a profit of roughly $2 billion on an initial investment of a little more than $300 million.

Icahn's investment in Netflix was clearly a success. Yet Netflix stock has continued to soar in recent years, and it recently surpassed $143 per share (approximately $1,000 per share on a pre-split basis). If Icahn had held on to his original position, he would be sitting on a gain of more than $5 billion by now.

Around the same time Icahn was selling the last of his Netflix shares, he was talking up Apple stock in a big way. He initially invested in Apple in mid-2013, after the stock price plummeted from a peak of $700 to around $400. Icahn eventually accumulated nearly 53 million shares (accounting for a later 7-for-1 split) at an average price of about $70 per share (or $420 per share in pre-split terms).

Icahn then wrote a series of letters urging Apple to buy back stock. These letters pegged the company's intrinsic value at ever more lofty heights, topping out at $240 per share in May 2015.

Less than a year later, Icahn had liquidated all of his Apple holdings, winding up with another $2 billion profit (albeit on a larger initial investment this time). He attributed his abrupt change of heart to concerns that Chinese government policies would undermine Apple's growth.

And once again, Carl Icahn left a lot of money on the table, as Apple recently returned to EPS growth. If he had held on to the stock, his gains would have reached $3.7 billion by now.

Just as Icahn was dumping Apple stock, Buffett's Berkshire Hathaway began accumulating shares. By the end of 2016, Berkshire had acquired more than 61 million shares at an average price of around $110. Buffett more than doubled that Apple investment in January 2017 to about 133 million shares. Berkshire Hathaway has thus profited from Apple stock's recent run, which has left it trading near $140.

Buffett's Apple stake is now worth more than $18 billion and is already showing a paper gain of more than $3 billion. Unlike Icahn, Buffett is likely to ride out Apple's ups and downs going forward, recognizing that the company is a great business with a bright future.

Pessimism doesn't pay (in the long run)

A second problem that has dragged Icahn down in recent years is his pessimism. For the past year in particular, Icahn's hedge fund has had a massive net short position -- i.e., a big bet that the market would plunge. During 2016, the losses on these short positions overwhelmed the gains on the few stocks that Icahn's fund owns.

By contrast, Warren Buffett is an eternal optimist. In his recent 2016 Berkshire Hathaway shareholder letter, Buffett wrote: "One word sums up our country's achievements: miraculous. ... Starting from scratch, America has amassed wealth totaling $90 trillion."

Indeed, the evidence clearly shows that long-term investors should be optimists. A single dollar invested in the market at the beginning of 1871 would be worth about $300,000 today (assuming you reinvested your dividends). Even after adjusting for a century and a half of inflation, the dollar would be worth more than $15,000.

Just looking over the past decade, index funds tracking the S&P 500 have generated a total return of more than 100%, despite sustaining a 50% drop during the Great Recession.

Obviously, bear markets happen, and they can be very painful for investors. A pessimistic investor is bound to be right some of the time. But given that the stock market's long-term trajectory is strongly positive, it's far better to err on the side of optimism and be patient during market downturns than to bet against the market.

Great companies are the greatest investments

During the course of his long career, Carl Icahn has shown that a savvy investor with plenty of capital can make a boatload of money by shaking up companies that aren't living up to their full potential. His success has paved the way for today's crop of activist investors.

Nevertheless, Warren Buffett has demonstrated that it's possible to generate more consistent outperformance by finding great companies and investing in them for the long term. This allows the magic of compounding to go to work, turning years of profit growth into huge gains for investors. That's why investors should aim to invest like Warren Buffett -- not like Carl Icahn.