I used to dry my clothes on a rack with a dehumidifier. Bought a heat pump drier. It’s a lot quicker, more convenient and uses less energy. I also had one of those heater racks which was very good at drying the exact line on the clothes where they where hanging.
À heat pump dryer is basically a big dehumidifier but in a closed loop and all self contained, a dehumidifier is doing the same job but in a room.
A good heat pump dryer will always be more efficient but will cost a lot more than a dehumidifier but you also don't lose a room to drying clothes.
I used a dehumidifier for years but after having a heat pump dryer I'd never use a dehumidifier for drying clothes over one given the choice.