In the world of government waste, there’s shrimp on a treadmill, and then there’s the F-35.

Both have become synonymous with the proverbial phrase “waste, fraud, and abuse,” though there’s one very important difference between the two: their cost. Even the most generous estimates of the widely mocked “shrimp on a treadmill” government-funded study put its total cost at $3 million over the course of 10 years. That’s not chump change, but, in the context of the federal budget, it’s also barely more than a rounding error.

In contrast, the F-35, which is supposed to be the latest, greatest tactical fighter ever produced, runs more than $100 million per plane. Including development costs, as well as operations and maintenance, the F-35 fighter initiative is estimated to cost well over $1 trillion during its lifetime.

The problem, however, is that these estimates are already tens of billions of dollars over original projections, and each subsequent estimate has trended higher than before. All this for a plane that, in addition to its cost overruns, has seen problems with everything from defective helmets to overall low readiness rates .

It’s for these reasons, in an era of massive deficits and increasing debt, that the F-35 remains the poster child for what happens when big ideas meet a lack of accountability. And, while there are many reasons why the fighter has become a favorite punching bag of budget hawks, consider just one aspect in particular: its engine.

Defenders of the engine point to its potential military capabilities and supposedly falling costs , which currently sit at about $12 million per plane. Unfortunately, those costs are relative to projections and thus don’t represent actual taxpayer savings. No wonder the Pentagon itself recently opened an investigation into the engine’s lackluster savings compared to a similar program.

Don’t get me wrong: There’s a need for the U.S. military to have the absolute best available technology for war fighting. But that doesn’t justify open-ended budgets. There are many opportunities for intelligent reduction of federal spending while still accomplishing military goals.

There’s no better example of this than what we’ve seen play out in Afghanistan.

Like the F-35 program, the Afghanistan War has seen tremendous lapses in accountability, as seen in the blockbuster revelations the Washington Post reported in December. Lives were lost as leaders misled the public about supposed progress, while our nearly two-decade presence only diminished U.S. military capabilities and sacrificed our credibility in the international community.

But often overlooked, as with many government programs, is just how much that conflict cost — and continues to cost.

One recent report estimated that we’ve spent or incurred obligations totaling $2.5 trillion in Afghanistan. More importantly, it also found the potential for savings of nearly $400 billion in just four years. For context, that’s nearly 10% of projected deficits during that time. If only someone had thought of this earlier.

In the end, it might be too late to salvage the sunk costs of the F-35 or our past spending in Afghanistan, but there are important lessons to be learned from both. Arguing for programs and conflicts to continue ad infinitum irrespective of their fiscal implications is a recipe not just for cost overruns but for strategic and tactical blunders, as well.

Jonathan Bydlak (@jbydlak) is the director of the R Street Institute’s Fiscal and Budget Policy Project and the creator of SpendingTracker.org.