http://www.perlmonks.org?node_id=453133


in reply to Loose vs. Tight Coupling

The looseness of coupling versus performance is one of the most common, and often the most difficult decisions I make in my job as a programmer.

I *love* modular designs - they feel right for me. I like it when I can reuse a module - so much time saved ! I like thinking modularly, it simplifies the process and allows to build complex programs easily.

However, modularity often comes at the price of degraded performance. It's a basic fact of life, tighter coupling improves performance because of lessening the cost in the interfaces.

The best solution to this problem, IMHO, is the common engineering trade-off. I tend to design modularly, then profile. Wherever the performance matters most (remember those 80/20 rules) I tighten the coupling.