liveBook · Manning

Complexity

As explained in Vibe Engineering

Software complexity is the degree of difficulty involved in understanding, changing, operating, or coordinating a software system.

A performance optimization can make a system harder to maintain or operate without improving the workflow that matters. Complexity may live in code, maintenance, or the components a system relies on. When traffic and latency requirements are unclear, favor maintainable code until measurements justify a more complicated design. section 7.1

A one-word change with hidden costs

Replacing a Java account lookup’s stream() with parallelStream() adds multithreading: processing should be stateless, the thread pool needs monitoring, and debugging becomes harder. Splitting work also costs time. For an assumed workload of up to 10,000 accounts, a JMH benchmark found nearly identical performance, so the result did not justify the operational complexity. section 7.1.1

Listing 7.5 Viewing the performance benchmark output
CH05.premature.AccountsFinderPerformanceBenchmark.baseline avgt 10 0.027 ± 0.002 ms/op
CH05.premature.AccountsFinderPerformanceBenchmark.parallel avgt 10 0.030 ± 0.002 ms/op
 

Compare the measured baseline and parallel lookup times; the small code change does not expose the operational costs. section 7.1.1

AI-generated optimizations can magnify the same mistake. A prompt directing an LLM away from single-threaded processing produced several concurrent strategies without establishing the expected dataset size. Its custom benchmark also assumed 100,000 accounts and had potential measurement problems. Give the model realistic workload constraints, and verify its proposals with a reliable benchmark rather than trusting the generated test. section 7.1.2 section 7.5

Before accepting added complexity:

  • State the expected input size, traffic, and performance goal; compare alternatives under those assumptions. section 7.1 section 7.1.1
  • Measure the hot path. A slower but rarely called endpoint may consume less total processing time than a faster, frequently called one. section 7.2
  • Account for review, deployment, monitoring, and cognitive load. Broad changes and excessive metrics can make optimization harder to evaluate. section 7.5

How Vibe Engineering covers it

How deep it goes
Explains code and operational costs through a benchmarked concurrency example, then gives measurement and workload checks.
Examples
Compares sequential and parallel account lookups and examines LLM-generated concurrent strategies under assumed workloads.
What you can do after
Evaluate performance proposals against workload evidence and the operational costs they introduce.
How it connects
Connects complexity to premature optimization, multithreading, benchmarking, hot paths, and monitoring.

Also explained in

Compare how 15 books explain complexity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.