You are correct in that the speed is tied to the unit/ship build speed. However, remember those costs are dynamic.
There are three methods to speed upgrading. By researching industrial efficiency you lower the cost of any and all units and is the cheapest method, but limited by the available techs. The most effective method is by increasing "practicals" of the units you see a large need in future upgrading. If you build 10 DD's you will find that the upgrade time is far less than if you only built 1DD. Production laws also have an impact on the various costs. Indirectly, ministers that reduce practical decay of certain units have, over the long run, a very significant impact on upgrading.
I can, at will, reduce the future upgrading costs by 66 to 75% simply by building more of the desired units. Of course, it is not possible to build large quantities of everything--long term planning is needed if you want to get the most bang for the buck.