Note: CPU control can damage your hardware e.g. by the CPU overheating. As for all Tasker functions, you use it at your own risk!
On a rooted device (only) Tasker is able to control the CPU frequency of an Android device to some extent. This is usually done either to save battery or make the device more responsive depending on the circumstances.
The relevant control action is CPU in the Misc category. You can monitor the current state with the variables %CPUFREQ and %CPUGOV.
There are two aspects which can be controlled, the Frequency Range and the CPU Governor. You will need to experiment with combinations of these to achieve the best results.
You can set the minimum and maximum frequency which the CPU is allowed to run at. Only certain frequencies are valid, depending on the CPU (click on the magnifying glass button to select a valid value).
The maximum frequency is probably initially set lower than the maximum frequency that the CPU can actually handle. If that is the case, you should be very cautious about setting it higher. Tasker will warn you the first time you try to do configure an action to do that, assuming you have not been using other apps to change the maximum frequency limit.
The active governor decides what the CPU frequency should be set to at a particular time, within the frequency range you have set. Each has it's own unique strategy. Here are the most common governors:
Not all governors are available on all ROM versions. Your device may also have a governor not described here. You can still set that governor with Tasker.
/system/app/Superuser.apkis present and
suis present in one of the directories of $PATH
/system/etc/scaling_available_frequencies(in that order). If you know what your CPU frequencies are, you could write them (space-separated, in numerical order) to the first (any number of CPUs) or last (1 CPU only) of those files.