in line for iphoneFabrizio Bensch/Reuters

Each time I wait in the snaking checkout line at my local Trader Joe's, I have to remind myself of an important point: The line may be long, but it's saving me time.

The truth is, human beings hate standing in lines, but we love being at the front of them.

According to a growing body of evidence in "queueing theory," that's a recipe for inefficiency.

Whether they're checkout lines or the lines outside the Apple store before a launch, inefficient line designs are wasting precious hours of our lives.

Take the supermarket.

Most major stores offer a dozen or so checkout lanes, all of which call upon the cart-pushing shopper to make a snap judgment about which line will move fastest. This is comforting psychologically because we like to feel in control, but it actually ends up increasing the average wait time, says Bill Hammack, an engineer at the University of Illinois, Urbana.

Hammack, who hosts a YouTube channel where he explains how everyday stuff works, says the supermarket problem comes down to simple probability.

If there are three cash registers, there's only a one in three chance you'll pick the fastest one. Two-thirds of the time, you'll see the other lines gliding by while you're stuck waiting, watching your ice cream thaw.

The solution: Abolish individual checkout lanes and replace them with one long line that feeds to registers as they open up. 

For a store with three registers, Hammack says, it ends up being about three times faster. My local Trader Joe's already does this, as do Best Buy and TJ Maxx. While customers no longer get the rush of victory from picking the fastest line, ultimately they leave the store earlier.

In typical cases, a delayed register wastes the time of everyone in that lane. In a single queue, a delayed register only affects one person; other registers will still open up.

But what about when Apple or Best Buy release products on a first-come, first-serve basis?  People may show up days ahead of time, hoping to secure The Cool New Thing.

This is a different kind of line than supermarket checkouts, and it can also be improved.

In separate studies, one in 2012 and another in 2014, Danish researchers found that, if stores want to minimize wait times, they should flip the script: The people who arrive last should be the ones who get served first.

In the 2014 study, an experiment involving 144 participants revealed that giving preference to both the earliest arrivers and people at random increased average wait times. Giving preference to those who showed up last, however, made it pointless for people to set up shop a week ahead of time, so they didn't.

But adopting this set-up en masse would irritate a lot of people.

When we banish typical line rules, research has found, the sense of fairness that accompanies them goes out the window. People feel robbed.

People who stand in line longer feel they are more deserving of service because they paid for it with their time. (If you don't buy that theory, the next time there's an iPhone release, cut the first person in line and see what happens.)

The first person in line might also irrationally assume that being first somehow signifies to the universe that they must be most deserving; otherwise, they wouldn't be first.

Like the thrill of buying our fruits and vegetables before those less cunning, the first-come-first-served model gets people thinking in terms of rewards instead of logistics. The line to buy the thing becomes more important than the thing itself.

If the research on lines tells us anything, it's that everyone will be better off if those irrational practices are abandoned. It's something to think about the next time you're setting up your tent on a sidewalk.