Method of operating a heat pump laundry dryer or a heat pump washing machine having drying function, wherein the laundry dryer or washing machine comprises: a control unit controlling the operation of the laundry dryer or washing machine, a laundry drum for treating laundry using process air, a process air circuit for circulating the process air, a heat pump system having a refrigerant loop, in which the refrigerant fluid is circulated through a first and a second heat exchanger (10, 12), a compressor for circulating the refrigerant fluid through the refrigerant loop, and a cooling fan unit for cooling the compressor, wherein the method comprises: modifying or changing an operation parameter set of the cooling fan unit in dependency of at least one input variable; characterized in that the at least one input variable is at least one of the following input variables: a user selectable input variable being one or more of: a laundry type, a drying program type, a residual laundry humidity, an energy saving and/or drying process time saving option, a laundry amount, a final laundry humidity, and a drying level; a working parameter of the laundry drum being a power consumption of a drum motor, a rotation speed of a drum motor, a voltage, current, or phase supplied to a drum motor, a motor torque of a drum motor, or a laundry parameter derived from the power consumption of a drum motor; a working parameter of a process air fan being a process air fan rotation speed, a process air fan motor power consumption, a process air fan flow rate, or a voltage, current, or phase supplied to a process air fan motor; a drying progress status parameter or a status parameter of the laundry to be dried, and an environment parameter of the treatment apparatus environment being the humidity of ambient air outside the laundry dryer or the washing machine. a control unit controlling the operation of the laundry dryer or washing machine, a laundry drum for treating laundry using process air, a process air circuit for circulating the process air, a heat pump system having a refrigerant loop, in which the refrigerant fluid is circulated through a first and a second heat exchanger (10, 12), a compressor for circulating the refrigerant fluid through the refrigerant loop, and a cooling fan unit for cooling the compressor, modifying or changing an operation parameter set of the cooling fan unit in dependency of at least one input variable; characterized in that the at least one input variable is at least one of the following input variables: a user selectable input variable being one or more of: a laundry type, a drying program type, a residual laundry humidity, an energy saving and/or drying process time saving option, a laundry amount, a final laundry humidity, and a drying level; a working parameter of the laundry drum being a power consumption of a drum motor, a rotation speed of a drum motor, a voltage, current, or phase supplied to a drum motor, a motor torque of a drum motor, or a laundry parameter derived from the power consumption of a drum motor; a working parameter of a process air fan being a process air fan rotation speed, a process air fan motor power consumption, a process air fan flow rate, or a voltage, current, or phase supplied to a process air fan motor; a drying progress status parameter or a status parameter of the laundry to be dried, and an environment parameter of the treatment apparatus environment being the humidity of ambient air outside the laundry dryer or the washing machine. a user selectable input variable being one or more of: a laundry type, a drying program type, a residual laundry humidity, an energy saving and/or drying process time saving option, a laundry amount, a final laundry humidity, and a drying level; a working parameter of the laundry drum being a power consumption of a drum motor, a rotation speed of a drum motor, a voltage, current, or phase supplied to a drum motor, a motor torque of a drum motor, or a laundry parameter derived from the power consumption of a drum motor; a working parameter of a process air fan being a process air fan rotation speed, a process air fan motor power consumption, a process air fan flow rate, or a voltage, current, or phase supplied to a process air fan motor; a drying progress status parameter or a status parameter of the laundry to be dried, and an environment parameter of the treatment apparatus environment being the humidity of ambient air outside the laundry dryer or the washing machine.