A. J. Marsden, an assistant professor of human services and psychology at Beacon College in Leesburg, Fla., suggested checking to see if a cashier was talkative and commenting on every item being scanned. If so, avoid this line “unless there is no one in that line, in which case, just deal with the chatty cashier,” she said in an email.

Study the customers ahead and what they are buying

It is not just the number of people ahead of you, but their age and what they are buying that can make a difference, Professor Marsden said. Older people will take a bit longer because they can have difficulties that delay the checkout process, such as not understanding how a debit card works, she said.

Also consider the number of different items they are buying, Professor Larson said. Six bottles of the same soda will go faster than six totally different items, some of which cannot be scanned, such as vegetables, he said.

If you have no irregular items, such as produce, use a self-service checkout, Mr. Meyer said. “You’ll lose the human contact but gain time,” he said.

Choose a single line that leads to several cashiers

Not all lines are structured this way, but research has largely shown that this approach, known as a serpentine line, is the fastest. The person at the head of the line goes to the first available window in a system often seen at airports or banks.

Getting into a single line also provides a sense of psychological relief because it eliminates the choice of where to go and second-guessing about the best line to choose, said Julie Niederhoff, an assistant professor of supply chain management at Syracuse University.

Still, most people prefer to take their chances with parallel lines — individual lines dedicated to a single cashier — even though most of the time they end up picking a slower line, Professor Marsden said.