`Final` Optimization Recommendations

That’s a highly opinionated programming style

If an opinion is backed by some data or facts, it becomes an argument :slight_smile:

Here is my little test of compiling Swift source files from clean, based on ~400 classes:
Left side: all classes were marked as final
Right side: final removed from all classes

no final all final
49.6s 39.9s
41.5s 44.1s
50.6s 40.1s
49.3s 38.2s

Data set is small and I am not providing build configuration, etc, but that is intentional. All projects are different so results might vary. Making little test like the one above could drive the decision. There is no one size fits all.

1 Like