Ok now add a Path shape that has to calculate the area of a polygon with arbitrary complexity.

Consider how the workload is now dominated by the core task of actually calculating the area, reducing the impact of struct usage.

Consider the diffs required to make this change.

It's not like Clean Code should be taken as gospel but this micro-benchmark is not a realistic example of what CC is trying to solve.

In that case, you'd branch into a separate function/block that runs the calculation. Sure, it's slower than a simple array index to find a coefficient, but you're only incurring that cost when you actually need it and it's still much faster than using polymorphism everywhere instead.

The problem in both of these cases is to how prioritize the complexity of the domain vs. the cognitive overhead of the implementation vs. the computational complexity. If the domain is complex and best represented by modeling the domain, model the domain. If the domain is simple and the the complexity is low, make it simple. If the computational complexity is high and the domain is complex, then all solutions will be bad so minimize the suck in the best way that you know how.

Occam's razor applies to all domains. Don't use confusing implementations until there are no good options left.