Up 40% so far in 2015, GameStop (GME 2.56%) is the seventh best performing stock in the S&P 500.

GME Chart

GME data by YCharts

You read that right. GameStop, the video-game retailer that everybody loves to bash, is trouncing the market this year -- yet again.

We're talking about a company that's closing 250 video-game stores each year as sales move online. Publishers Electronic Arts and Activision Blizzard are booking record profits thanks to that digital shift. But GameStop's business just isn't playing along in the doomsday script that bears had written for it. 

Record video game results
The retailer logged a hefty 9% sales jump last quarter at existing locations as its grip on the video-game industry continued to strengthen. GameStop's market share of new software sales increased to a record 45%. The company also extended its lead on next-generation devices and games: It accounted for 46% of all hardware and software sales tied to the Xbox One and PlayStation 4 consoles in the first quarter. 

Retailing rivals Wal-Mart to Best Buy couldn't come close. "The model of reserving games, providing unique content, and delivering midnight launches continues to differentiate us in the market," CEO Paul Raines told investors.

GameStop thinks merchandise sales can growth to a $500 million business by 2017. Source: GameStop investor presentation

And GameStop recently found a new way to profit from its industry leadership role. It's expanding into merchandise, toys, and collectables, which management sees driving a solid sales boost this year around popular franchises like Star Wars and Avengers.

Diversification and cash returns
Meanwhile, GameStop's other business lines are making big contributions to profit growth. Cell-phone service and consumer-electronics sales, managed under the Spring Mobile, Simply Mac, and Cricket brands, increased by 70% last quarter. Profitability for this "Tech Brands" division also leapt to 40% of sales. By comparison, GameStop earns just 9% from video-game hardware sales, 23% from new software sales, and 37% from video-game accessories. Tech Brands only trails downloadable content (77%) and preowned games (49%) in terms of the company's most profitable products.

Tech Brands accounts for just 9% of GameStop's revenue right now. But that percentage is sure to spike as management plans to open 200 new stores in the division this summer alone. And as those sales grow, they are likely to boost GameStop's overall profit margin north of its current 31% mark.

Management has also been aggressively returning excess cash to shareholders, providing another boost to the stock. GameStop's 3% dividend yield is one of the highest in the retailing industry, and it was most recently raised by 9%. Still, management prefers to direct most of its capital to share repurchases: It spent $333 million on stock buybacks last year compared to $149 on dividend payments. GameStop's outstanding share count is down 26% since 2010.

Outlook
The current quarter should be a weak one for GameStop's business. Video-game sales will be pressured by a comparison against a banner crop of titles that came out in the prior year period, led by Mario Kart 8, Watch Dogs, and The Last of Us. A weaker release calendar this year (Batman Arkham Knight and Bewitcher 3) will likely keep comps flat, management told investors in May. GameStop's record number of Tech Brands store openings means that earnings won't be robust, either. Overall, Wall Street analysts are forecasting flat revenue and a 9% profit gain for the retailer's second quarter. Then sales growth is expected to recover as big games like EA's Star Wars Battlefront and Activision's Call of Duty Black Ops III hit shelves in the fall. GameStop should book as much as $9 billion in revenue and $3.87 per share in profit for 2015.

Those aren't the kinds of numbers you'd see from a company whose core business is being rapidly disrupted by e-commerce trends. Instead, GameStop is cashing in on this popular generation of video-game consoles while transitioning into new, more profitable product lines.