chapter seven

7 Vibe Performance Engineering: When assumptions mislead

 

This chapter covers

  • Are LLM tools prone to the same mistakes as humans for performance engineering?
  • Optimizing to the hot-path vs automatically addressing broader performance issues
  • Identifying the implicit assumptions about the trade-offs that LLM tools can make

In this chapter, we will attempt to address two main problems related to improving the performance of our code, that is, optimizing based on false assumptions and not optimizing the hot-path.

Before delving into vibe engineering techniques, let’s describe those two main concepts that are impacting the performance engineering process. The first issue is premature optimization, specifically when code is optimized without input data on expected traffic and a service level agreement (SLA), making it difficult to reason about the code's required performance. Optimizing random paths in code in such a situation is like shooting in the dark. You will complicate your code without a sane reason. We want to prevent a situation where the code is prematurely or inaccurately (for a given traffic) optimized, resulting in over-engineered and hard-to-maintain code. Human engineers are often tempted to optimize code that may achieve better performance prematurely, but this performance may not be utilized since the traffic the code is expected to handle may be orders of magnitude lower compared to the traffic where the code actually demonstrates its improved performance.

7.1 Mistake of LLMs over-engineering performance improvements

7.1.1 The human solution

7.1.2 Vibe Performance Engineering Solution

7.1.3 Adding Traffic Expectations to the Vibe Performance Engineering Solution

7.2 Vibe Performance Engineering of the Hot-Path in code

7.2.1 A word service with a potential hot-path

7.2.2 Hot-path detection in your code

7.3 Measuring the code

7.3.1 Measuring the code with Vibe Performance Engineering techniques

7.3.2 Mistake of generating too much code

7.4 Improvements for hot-path performance

7.4.1 Improving the performance with Vibe Performance Engineering techniques

7.4.2 Compare performance results based on Gatling simulations

7.5 Concluding thoughts

7.6 Summary