sp

The scope of efficiency

This post belongs to a small series on the dangers of blindly pursuing efficiency in software development. The main post is The cost of efficiency. This post discusses the scope aspect of efficiency.

Efficiency never happens in a vacuum — it occurs within a specific context, for a given scope, and we need to know what that scope is before we optimize. Individual components, processes or “resources” may be efficient on their own, but if they don’t work well together, there will be waste across the whole system. In other words, efficiency isn’t just about optimizing individual tasks or elements; it’s about making sure all the parts of a system work harmoniously together.

“Local optimization creates global suboptimization.”

Revisit our restaurant

Let’s make this concrete with our three-star restaurant “Triple D” again.

Our restaurant consists of several “departments” that together make up the customer experience. The kitchen prepares and cooks the food, while the bar handles drinks and crafts exclusive cocktails. The waiters take orders, serve food and drinks, and look after overall customer satisfaction. The management team oversees operations, including staffing and inventory.

restaurant The flow of our restaurant

Each department strives to be as efficient as possible, but needs to watch that its own optimization doesn’t hurt the whole.

The kitchen could batch identical dishes from different orders to cook more efficiently — at the cost of a longer wait for the first order in that batch.

Waiters could take all of a table’s orders — drinks, food, dessert — at once, and group orders across tables, to minimize trips to the bar and kitchen.

Management could cut costs by trimming staff and food waste — but that can easily leave departments understaffed during peak hours, or short of ingredients to fulfill orders.

More examples like this aren’t hard to find: a local efficiency gain in one department, at the whole restaurant’s expense.

“Optimizing a part of the system will not necessarily optimize the whole.”

Systems thinking

Luckily, a lot of study has gone into efficiency within systems and how individual components interact with the larger whole. The domain of systems thinking 1 focuses on understanding complex systems as a whole, including how their various components interact and influence overall performance. It emphasizes the interconnectedness of components within a system and examines how a change to one part can affect the system as a whole.

Closely related to systems thinking is Lean 2. Where systems thinking provides the conceptual framework for understanding complex systems and their behavior, Lean offers the practical tools and methodologies for applying those principles.

Both systems thinking and Lean aim to improve efficiency within organizations by identifying and removing waste. One of the main sources of waste in a complex system that they target is queues.

“Any improvements made anywhere besides the bottleneck are an illusion.”

Queueing theory

Ignore the scope of efficiency, and you risk optimizing individual components without considering their impact on the whole — which inadvertently creates queues and inefficiency elsewhere in the system.

“Queues are the silent killers of efficiency, draining resources and stifling progress.”

In our restaurant, queues can form at every department:

  • If the kitchen or bar can’t complete orders fast enough, a queue of pending orders forms, increasing the completion time of an order.
  • If the waiters can’t deliver the prepared food and drinks fast enough, a queue of orders-to-be-served forms, hurting not just completion time but quality too — food goes cold, or orders arrive out of sequence, or all at once.

queues Queues, the invisible killers

The study of queues — queueing theory — can teach us a lot about reducing queues and achieving good flow in a system. Queues come at great cost, and queues grow faster than they shrink. The biggest danger of queues in product development is that they’re invisible — unlike inventory stock on a factory floor, queues in software development aren’t visible at all.

This restaurant example maps directly onto how software teams work. Michel Grootjans has a good explanation of queues, WIP, and their impact on team flow.

“In the quest for productivity, queues are the dragons to be slayed, the obstacles to overcome.”

Project scope

In the previous post, I talked about losing resiliency when blindly striving for efficiency. One case where efficiency really could matter more than resiliency is when the scope of the work is a project — specifically, delivering software as an external party within a promised time and budget. In that scope, the efficiency argument comes up constantly, driven by deadline and budget pressure. The mindset tends to be that there’s no need to be resilient or share knowledge in project mode: commit to the deadline, deliver within the promised time and budget, and move on to the next project.

That can work:

  • if the environment is well controlled;
  • if the timespan is short enough to avoid unexpected changes;
  • if the requirements are small and limited enough that the estimates stay realistic.

That’s a lot of ifs, though — and it doesn’t even account for what happens to the software once the project ends. Who maintains it? What’s the quality of software delivered under the pressure of being efficient, of fitting everything into a fixed time and budget?

deadline Efficiently making the deadline

I’ll go further: delivering software in a project scope just postpones the cost of “being efficient.” Once the project is delivered, the software still needs to be maintained, and that knowledge doesn’t transfer easily through written documentation alone. The design decisions made to deliver the project efficiently keep shaping the cost of using, maintaining, and extending the software long after the project ends.

“There is never enough time to do it right, but there is always enough time to do it over.” – Murphy’s law

I’m wary of the whole idea that software projects can be “finished.” I’ve spent too many years fixing “successful” software projects years after their delivery deadline. Looked at beyond the project’s own scope, those successes often weren’t so successful: the cost of having delivered the software “efficiently”, at the expense of resiliency, more than outweighed the gains of hitting the deadline and budget.

“Software is never finished, it’s only abandoned.”

Conclusion

Take the scope into account for whatever you’re optimizing. If you’re aiming to be “more efficient,” what’s the impact on the larger system? Are you even optimizing the right thing? The cost of local optimization can easily outweigh the gain.

“The performance of a system is not the sum of the performances of its individual parts, but the product of their interactions.”

traffic Queues are bad

The blog posts in this series: