Grit is good. At least, that’s the advice most college counselors, middle managers, Spelling-Bee coaches, and most anyone who’s ever advised someone will give you. American culture, in particular, esteems the Jobs of the world (both the Biblical and Steve-ial), who stick to it when everything is going wrong.

Psychologists, too, have long viewed perseverance as a plus. Writing in Science magazine in 1907, the psychologist William James called on his peers to study how certain people seem to draw on inner strength to accomplish great feats:

The human individual lives usually far within his limits; he possesses powers of various sorts which he habitually fails to use. He energizes below his maximum, and he behaves below his optimum … [T]he habit of inferiority to our full self—that is bad.

Then again, amid all the exhortations to be “too legit to quit,” what if another song actually serves as a better guide to life—one whose message is less demanding, perhaps, and understands what it’s like to have eff reserves hovering dangerously near zero. What if it’s more important to know when to hold 'em, know when to fold 'em, and know when to walk away?

For a recent study published in the Journal of Research in Personality, researchers from the University of Southern California and Northeastern University put hundreds of participants through a series of three studies on grit. In each, the researchers quizzed subjects about how “gritty” they are, based on how much they agree with statements like, “Setbacks don’t discourage me” and “I finish whatever I begin.”

The first test was a set of anagrams, or word scrambles, which participants were rewarded for solving by being entered into a $100 lottery for each correct answer. Sprinkled amid the do-able anagrams were 16 unsolvable words and 21 very difficult ones, like “kismet.” The participants who ranked higher on the grit assessment attempted fewer anagrams overall—a sign they didn’t skip the difficult or unsolvable ones like their less determined peers did.

Next came a computer-game exercise, which the researchers rigged such that some participants would feel like they were losing for much of the game. The grittier subjects worked harder when they were losing, but not when they were winning.

For the final test, the researchers gave the subjects a math game, which was also rigged so that some of the participants felt like they were fighting an uphill battle. They also gave the participants an offer: When things got tough, they could either drop out of the experiment and get $1 for their troubles, or they could press on and get $2 if they won, but nothing if they lost. Grittier people didn’t solve any more math problems than their lazier counterparts, even though they felt more optimistic about the test than the others. They were, however, more likely to continue the game when they were losing, even though they risked walking away with nothing.

It would seem, then, that grit comes with a downside. Gritty people stick with the task before them, but sometimes it’s at the expense of their own financial gain—and even overall performance. This kind of “costly persistence” has many applications outside the lab. Think of an SAT test, where it behooves the test-taker to skip over problems that are too hard in order to answer more of the questions correctly. Or, consider the perks of buying the frozen Trader Joe’s egg rolls for the party rather than wrangling a pot of hot oil in your studio apartment. The key is knowing when laziness pays off.

“Right now, there’s an effort to push everyone to be more gritty,” said Gale Lucas, a researcher with the USC Institute for Creative Technologies, in a statement. “There’s no reason not to make people grittier, but it’s important to know when to quit and reevaluate rather than blindly push through.”

In general, willpower in the face of adversity is an asset. But as this study (and real life) illustrates, some things are just not worth achieving, no matter how gritty you are. Grit, then, is like any other gift—it’s worth evaluating whether you’re using it to help, rather than hurt, yourself.