Felix’s contract will amount to a five-year, $139.5 million extension; Hernandez already was signed through ’14. However you do the math, the numbers amount to a massive investment and massive risk, even though at the end of the deal, Hernandez will be only 33.

I get it — Felix is the face of the Mariners’ franchise, one of the game’s top-five starters, a pillar who will provide stability as the team incorporates a talented group of young pitchers over the next several seasons.

Still, there is no denying that long, expensive contracts for starting pitchers rarely provide good value. And the Mariners’ choice forever will be weighed against the hypothetical bounty that they could have received for Felix in a trade.

Just this offseason, the Tampa Bay Rays acquired perhaps the game’s top hitting prospect, outfielder Wil Myers, by parting with righty James Shields, a pitcher whose career ERA-plus is 107 — well below Felix’s 127 (the average ERA-plus, which is a pitcher’s ERA adjusted to his park and league, is 100).

The New York Mets, meanwhile, acquired perhaps the game’s top catching prospect, Travis D’Arnaud, as well as the Toronto Blue Jays’ top pitching prospect, Noah Syndergaard, for National League Cy Young Award winner R.A. Dickey, who is 38.

Hernandez would have brought back much, much more, but club officials never entertained the notion all that seriously.

Seattle loves Felix, Felix loves Seattle. To management — and to many M’s fans — it was unthinkable that the team would part with a homegrown superstar who — unlike former Mariners Ken Griffey Jr. and Alex Rodriguez — clearly wanted to remain with the franchise.

The commitment by both the player and team is admirable, as is the passion of the fans. But get back to me in a few years, and tell me if everyone still holds the same romantic view.

I’m sorry, the risk of trading Felix — even when factoring in the possibility that the return might have been disappointing — was less than the risk of signing him for $175 million.

Yes, Hernandez has averaged 238 innings over the past four seasons, thrown a no-hitter, won a Cy Young. But consider his ERA-plus by season during that period:

171, 174, 109, 122.

I’m not ready to say Felix is in decline, not when he has pitched for poor clubs and is at an age when he is just now entering his prime. But will the Mariners max out on their $175 million over the next seven years?

Consider New York Yankees left-hander CC Sabathia, who signed a seven-year, $161 million free-agent contract entering his age 28 season, then received a one-year, $30 million extension three years into the deal.

Sabathia, now 32, has given the Yankees four excellent seasons, as evidenced by his ERA-plus of 135. But twice last season he went on the DL, first for a left groin strain, then for left elbow soreness. His 200 innings were his fewest 2006, his ERA-plus of 124 his lowest since 2005.

Just slightly troubling, no?

Yes, particularly when you consider that the Yankees are obligated to pay Sabathia $94 million over the next four seasons, not to mention a $5 million buyout or $25 million on a vesting option in 2017.

Hernandez, when he starts his new contract, will be about a year younger than Sabathia was at the start of his. If Felix gives the Mariners four more terrific seasons, helping the franchise return to prominence, few will care if he fades at the end of the deal.

Every time that I have written that the Mariners should trade Felix — and yes, in recent years I wrote that more than once — I heard from numerous M’s fans who said, in so many words, “He’s ours. No one else can have him. Lay off!”

OK, I finally will follow these instructions, but not without a final word.

These contracts always sound great at the outset. Only later, in most cases, does everyone start to cringe.