寓言故事

港口船闸

罗尔丹把新船的图纸拍在港务长桌上。「六舱快船,满帆时速能把横渡时间砍到一半。我借了一千金币,下个月交船。」玛拉没抬头。「横渡五小时,船闸一小时。你知道这条航线的总时间怎么算吗?」

Roldan slapped the new ship's drawings onto the harbor master's desk. "Six holds, a fast clipper; at full sail it cuts the crossing time in half. I borrowed a thousand gold pieces, and the boat is delivered next month." Mara did not look up. "Five hours for the crossing, one hour for the lock. Do you know how the total time on this route is actually reckoned?"

「六小时一程,船快一倍,自然三小时。」「你砍的是五小时里的那一半,不是我这一小时。新船跑得再快,过船闸还是要一艘一艘地过。横渡两小时半,加闸一小时,三小时半。你省下的是两个半钟头,不是三个。」

"Six hours a run. The ship is twice as fast, so naturally three hours." "You're cutting half of the five hours, not my one hour. No matter how fast the new boat runs, it still has to pass the lock one hull at a time. Two and a half hours crossing, plus one hour at the lock, three and a half hours. What you save is two and a half hours, not three."

罗尔丹的声音低下去。他算过账:一千金币的债,要靠每天多跑一程来还。他原以为船快一倍,一程就变两程的产量。「那我再造第二艘快船呢?两艘并行,横渡不就更快了?」

Roldan's voice dropped. He had done the books: the thousand-gold debt could only be repaid by squeezing an extra run out of each day. He had assumed that a ship twice as fast would turn one run into the yield of two. "Then I'll build a second fast ship. Two running side by side, and the crossing gets even faster, doesn't it?"

「闸口只有一道。」玛拉终于抬眼,指了指窗外那道凿在悬崖里的窄口。「悬崖是祖辈留下的,凿不开,也加不了第二道。你在海上可以放一百条船,可它们都得在这一道闸前排队,一条过完才轮下一条。」

"There is only one lock gate." Mara finally raised her eyes and pointed out the window at the narrow gap cut into the cliff. "The cliff was left by our ancestors; it can't be cut wider, and a second gate can't be added. You can put a hundred boats on the open water, but every one of them has to queue at this single gate, one passing through before the next can follow."

「所以哪怕我把横渡缩到一瞬间……」「总也缩不到零。你最快也不过把六小时压到一小时;横渡再短,也要在闸前等满那一小时。横渡可以加速,过闸不能。你投在横渡上的每一枚金币,越往后越买不到等量的时间。」

"So even if I shrank the crossing to a single instant..." "It would never shrink to nothing. At best you compress the six hours down to one hour; however brief the crossing, you still wait out that full hour at the lock. The crossing can be sped up, the lock cannot. Every gold piece you spend on the crossing buys less time, the closer you get to the lock."

罗尔丹收起图纸。一千金币的债还在那里,可预期的回报已经少了一截。他望着那道石闸,忽然明白自己该把船卖掉,去雇石匠——可石匠也凿不动那悬崖。「那这债,我拿什么还?」「靠认清这条线在哪里。横渡是你的,闸不是。」

Roldan gathered up the drawings. The thousand-gold debt was still there, but the expected return had already shrunk by a slice. He stared at the stone lock, and for a moment understood that he ought to sell the boat and hire stonemasons instead, yet even stonemasons could not chip through that cliff. "Then what do I use to repay this debt?" "By seeing clearly where this line falls. The crossing is yours, the lock is not."

注解:此即阿姆达尔定律(Amdahl's law)——系统整体加速受限于被优化部分的实际时间占比,不可优化的串行部分为整体封顶;上限为 1/(1-p),越接近串行瓶颈,再投入资源收益越小。

Note: This is Amdahl's law (阿姆达尔定律). The overall speedup of a system is bounded by the fraction of time the optimized part is actually used; the unoptimizable serial portion caps the whole. The ceiling is 1/(1-p), and the closer one gets to the serial bottleneck, the less return each further investment yields.