Optimization of total cost of ownership (TCO) is an important, and challenging design target for present day manufacturing machines. This paper is concerned specifically with production machines with fast reciprocating loads (> 1 Hz), e.g. weaving looms and plate punching machines. Subsequent acceleration and deceleration give rise to a reciprocating energy flow that can be handled either mechanically or electrically. The chosen solution will affect the total cost of ownership. In addition to the cost of the energy storage device itself, there are the energy bill, the size and cost of the electric drive and power supply to consider. Moreover, there are certain constraints to be met: lifetime, DC-bus voltage limits and total power factor. This paper presents a methodology that takes all these aspects into account. It applies it to a bar linkage mechanism, which is representative for the targeted applications. In the mechanical domain, springs are considered for energy storage. The structural design of the spring is included in the analysis in order to account for lifetime and inertia added by the spring. In the electric domain, three different topologies are compared: a purely passive front end, where energy is stored directly on the DC-bus, a passive front end combined with a DC/DC converter and a separate storage capacitor, and an active front end.