TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A single line to 3 cashiers is ~3x faster than a separate line for each cashier

241 pointsby blakehillover 13 years ago

31 comments

pnathanover 13 years ago
FYI: This is an example of the branch of mathematics called queueing theory.<p><a href="http://en.wikipedia.org/wiki/Queueing_theory" rel="nofollow">http://en.wikipedia.org/wiki/Queueing_theory</a><p>It's a fascinating study requiring a good knowledge of probability to use beyond the simplified models. It turns out from the math that throughput using a single queue is better than using multiple queues.
评论 #3330109 未加载
评论 #3330107 未加载
评论 #3330486 未加载
评论 #3331103 未加载
评论 #3330820 未加载
评论 #3330213 未加载
dxbydtover 13 years ago
scala&#62; import org.apache.commons.math.distribution.{ExponentialDistributionImpl=&#62;expo}<p>//pc = process customer, with a mean time mu per customer<p>scala&#62; def pc(mu:Int):Double= new expo(mu).sample<p>// q = queue of n customers with mean process time mu<p>scala&#62; def q(n:Int,mu:Int):Double=(1 to n).map(_=&#62;pc(mu)).sum<p>scala&#62; // put 3000 people in 1 queue with mean process time 50<p>scala&#62; (1 to 1000).map(_=&#62;q(3000,50)).sum/1000<p>res43: Double = 83107.37275937156<p>scala&#62; //now put 1000 people each in 3 separate queues with the same mean process time as before<p>scala&#62; (1 to 1000).map(_=&#62;(1 to 3).par.map(_=&#62;q(1000,50)).sum).sum/1000<p>res45: Double = 200010.29627921886<p>200010 = ~3x83107, so yeah, single line to 3 cashiers is ~3x faster than a separate line for each cashier.<p>// Now make 1 queue that feeds into shortest of the 3 queues<p>scala&#62; def qq(n:Int,mu:Int)=(1 to 3).par.map(_=&#62;{(1 to n/3).map(_=&#62;pc(mu)).sum}).sum<p>scala&#62; (1 to 10000).map(_=&#62;qq(3000,50)).sum/10000<p>res70: Double = 141824.974765643<p>So our single queue feeding into 3 separate queues still beats 3 separate independent queues.<p>edited to address MaysonL's question.
评论 #3331391 未加载
评论 #3330575 未加载
评论 #3330948 未加载
评论 #3333632 未加载
评论 #3331804 未加载
评论 #3333780 未加载
Splinesover 13 years ago
A blend is probably a better choice.<p>It's obvious that single queues for each cashier isn't very efficient, but the tradeoff is that lines are visibly shorter, and progress to the goal is clear.<p>Having a single line for all cashiers (ala Fry's Electronics or an airline ticket agent) is more efficient, but the long line, logistics of finding the next available cashier, and uncertainty of completion make for a frustrating experience as well.<p>I posit that having N banks of 4-6 cashiers is a good balance between both. You get the efficiency gains of not being blocked by a bottleneck, and you also get visibly shorter lines and the benefits of estimating when you are next (ok, looks like cashier 1 and 2 are almost done, I should be out of here in a few minutes).<p>Someone here mentioned this kind of setup with self-checkout at grocery stores, and I think it works well, as long as the number of self-checkout stands in the "bunch" is not too large. There's a local grocery store where there's 8 of them, and it's a little too chaotic (IMO, anyway).
评论 #3330271 未加载
nlawalkerover 13 years ago
Most of the grocery stores in my area have installed self-checkout systems that are especially great if you just have a handful of items that all have UPCs (no produce or bagged bulk), don't have any items requiring an age check and possess at least the intelligence of a fifth grader.<p>I mention this not just because it's relevant to the idea of waiting in line at a store, but because in every store where I've seen these systems installed, the entire bank of scanners has a single line, unlike the rest of the store. I imagine it's mostly because they place the self-check scanners so close together (because they can) that it doesn't make sense to try to form multiple lines, whereas a single queue system for the real checkers would take up a huge amount of space.
评论 #3330266 未加载
评论 #3330086 未加载
评论 #3329930 未加载
评论 #3333261 未加载
评论 #3330595 未加载
评论 #3330953 未加载
bryanhover 13 years ago
An excellent video on the phenomenon from the "Engineer Guy" series: <a href="http://www.youtube.com/watch?v=F5Ri_HhziI0" rel="nofollow">http://www.youtube.com/watch?v=F5Ri_HhziI0</a><p>And just in case you feel like killing about 20 minutes of your day, check out the rest of his videos. They are excellent.
评论 #3330134 未加载
joezydecoover 13 years ago
The biggest queue problem I see in a large store is McDonald's.<p>In the early days, the food was all built asynchronously from the orders. Cashiers would walk back and fill the order themselves from the bin full of burgers and fries in pretty quick fashion and the customer would be on their way.<p>When the whole "made as you go" approach was started, McDs decided to keep the 1:1 cashier-customer model (unlike Burger King or Wendy's, who do it 1:N style).<p>So now you have customers ordering and standing around next to their cashier waiting for the food to be made, which the cashier has no control over. The order of filled requests is also somewhat random. If the kitchen is having trouble, people start piling up by the counter.<p>I've noticed that some stores are experimenting with a numbering system that is encouraging you to step back and watch a monitor for your order when it is ready.
smackfuover 13 years ago
Wouldn't it be 3x the velocity, but the line is 3x longer, so your total wait time is the same? The article is mainly saying that people like moving faster, but is that really a phenomenon?
评论 #3329917 未加载
评论 #3329854 未加载
评论 #3330092 未加载
评论 #3330064 未加载
digitalsushiover 13 years ago
I was at a Home Depot this summer in the garden section, 2 checkouts. I was straddling the middle, waiting for the next open lane. Some lady starts bumping into me with a large cart, pushing her way up my right. I looked at her with a frown, and she told me to pick a line. I told her I was 'next' and she scoffed and went into the right lane, and was serviced more quickly (but only randomly)<p>These little mental models of efficiency always make the nervous introvert in me worry that I am wrong, or if society in general publishes people who try something different.<p>The naive answer is to avoid retail interactions.
评论 #3329952 未加载
评论 #3329957 未加载
smackfuover 13 years ago
What I didn't see in this article is why retailers don't do this today. I see a lot of positives listed and no negatives, so it seems like a no-brainer, right? Yet the biggest retailers like Walmart and Target have tons of lanes, and even do staggered front/back lanes which are terrible for the customers. Is it because there are negative feelings to seeing a long line, and that people do not expect it to be fast so they abandon their purchase?
评论 #3330062 未加载
评论 #3330112 未加载
评论 #3330012 未加载
评论 #3329995 未加载
评论 #3330169 未加载
评论 #3330528 未加载
评论 #3330162 未加载
评论 #3330176 未加载
JoshTriplettover 13 years ago
It becomes even more obvious if you think of it like scheduling processes on a CPU. Why needlessly set CPU affinity and only run on a single CPU when you could just take the next available timeslice on any CPU?
评论 #3329968 未加载
评论 #3330141 未加载
seiwynover 13 years ago
Okay, I am confused.<p>Assuming rebalancing, it seems to me that your wait time EV is the same either way, with less variance in the single queue case. Thus the shopper throughput should remain the same. Can someone explain to me if/why this is wrong?<p>Also, where did the HN title come from? I could not find that claim in the article.
URSpider94over 13 years ago
When I went out for fast food as a kid with my grandfather (an engineer), he would send me and my brother and sister to each stand in one line. He would then come over to join whomever got to the front first. That was my first lesson in queueing theory ...
parfeover 13 years ago
<a href="http://en.wikipedia.org/wiki/Little%27s_law" rel="nofollow">http://en.wikipedia.org/wiki/Little%27s_law</a><p>The author writes about a Little's Law
secoifover 13 years ago
How many times have you been standing in a queue with the money in your hand, wishing you could just drop the money and get out, who cares about change, you just want to get the hell out of here.<p>This is my proposal for a "no change given" line.<p>You walk up, you plop down at least the amount of money that the items are worth, they quickly scan the &#60;5 items, check the money is at least as much as the total, then you move on. You don't get change, you don't get a receipt, they don't take cards. Just drop the money and run.<p>Good for business as they would collect many extra $$ from impatient shoppers, and good for shoppers who are impatient. All-round good.
trustfundbabyover 13 years ago
It also has an engineering analogy in Apache Passenger Global queuing. And this article explains why it works the way it does <a href="http://blog.phusion.nl/2008/10/29/phusion-passenger-now-with-global-queuing/" rel="nofollow">http://blog.phusion.nl/2008/10/29/phusion-passenger-now-with...</a><p>As an aside: The Fry's Electronics store in my city does this and the line does move at a pretty brisk pace, but I had always thought it a rather odd setup till I read this and made the connection to global queuing in Passenger. fascinating.
评论 #3330370 未加载
xtacyover 13 years ago
There's interesting work on queuing theory. In practice, each shopper picks the queue that she thinks is least loaded. How many queue lengths do you need to sample? It turns out that if you sample just two queue lengths, you get a huge benefit (in terms of reducing the avg queue length), but not so much if you sample more.<p>See "Power of two random choices": <a href="http://www.eecs.harvard.edu/~michaelm/postscripts/handbook2001.pdf" rel="nofollow">http://www.eecs.harvard.edu/~michaelm/postscripts/handbook20...</a><p>EDIT: link
ck2over 13 years ago
It's not a matter of logic.<p>When there is one cashier and a dozen customers waiting, that tells me the store is too cheap or too mismanaged to have other cashiers scheduled.<p>The best thing a store can do for customer relations is to open additional registers when too many customers are waiting, it implies the customer's time is important.<p>I also enjoy discovering it was the store manager themselves running the extra register - it means they stay in touch with how things are done (and how hard the cashiers have to work).
评论 #3330474 未加载
e40over 13 years ago
There are two Trader Joe's near me. One does a single line and the others have one for each cashier. I never go to the one with multiple lines. I hate it. The big, huge like that goes to the back of the store for the one with a single line.... I love it. I moves fast and I don't need to worry about picking a line. Even if it went just as fast as the other type, I'd prefer it, but now there's reason to love it even more.
mikecshover 13 years ago
This always seems intuitive to me. You see a single queue feeding multiple processors fairly often such as in banks and security queues at airports. They seem "fairer" to me as you are not disadvantaged by picking the "wrong" queue through a bad prediction. In a classic supermarket queuing scenario, you could pick the shortest queue but find that the person in front is incredibly slow, so the three people who came to checkout after you at other checkouts progress through the process faster. This is first come, first served.
blakehillover 13 years ago
So at least there's one thing that most big banks get right.
评论 #3329882 未加载
评论 #3329959 未加载
评论 #3329808 未加载
santimtover 13 years ago
This is not new, search for "MM1 queue" and you will get a lot of mathemathical results explaining why this effect happens. Is a study case of queueing models.
finisterreover 13 years ago
The article cites Apple's roving check out approach as an attempt to "solve line issues". Isn't this close to the most inefficient way to organize the checkout/queuing experience in terms of creating uncertainty and the need for everyone (even their staff) to move around? I can see that it has a lot of psychological value, though.
j_bakerover 13 years ago
<i>Another change: As soon as there are three or more people waiting in a line, the retailer deploys "line busters," employees who scan items in shoppers' carts before they reach the cashier, says Mr. Carey, who works closely with the retailer's operations team on line speed.</i><p>This isn't really news. WalMart's been doing this forever.
tomkarloover 13 years ago
When I interviewed for a PM job, one of my full hours was spent being asked to design a better checkout system for a grocery store, and show the math around how many registers were needed to ensure a certain maximum wait on line. It was definitely an interesting case study to use.
adamgravitisover 13 years ago
The parallel vs serial queuing problem is very well established within the operations research community.<p>And, IIRC, it's not that there's much impact to average performance, but rather that the variation (sigma) drops by a factor of n.
dudurochaover 13 years ago
I love studies like these. But I have a real problem trying to read it, the screen was so crowded. Does anyone knows a firefox extension that gives me only the text?
keithgover 13 years ago
Back in 1989 as one of our projects in a data structures course, we solved this problem and reached the same conclusions. We did it using Pascal!
评论 #3332792 未加载
mkramlichover 13 years ago
More time efficient: avoid ever being in a queue. Think Amazon, or, in meatspace go shopping at odd hours.
signa11over 13 years ago
which is exactly how the queue design on the ck scheduler is, people == tasks ofcourse...
buckwildover 13 years ago
Remarkably similar in design to hyper-threading. Lol!
bluesmoonover 13 years ago
any first year CS student who's done queueing theory knows that SQMS is more efficient than MQMS and SQSS