One rule of optimization: avoid needless work. Another rule: sometimes only a human can tell what's needless. Why PR 2974 matters.
Some changes suggest other changes, whether by exposing limitations of the existing design or revealing small improvements. Here's work in progress for managing maximum network connections.
Sometimes an easy change is a lot harder than it looks. Creating a setmaxconnections RPC command definitely was.