Don't forget that dockyards work at 100 % efficiency from the start (both of the production and the game) and factories have 4.5 compared to 5 NIC production.
They also start at some 50% efficiency and take 10 years to reach 100%, so in all Fairness, dockyards are not getting worse, the worse option in terms of Output gets better faster.
Sorry about correcting you, but dockyard output is 2.5 instead of 5.
Per the HOI4 wiki
- 3
- 1