The way I set this to stick since the governor defaults back to powersave after about 30 seconds now as of Ubuntu 16.04 or more recent (I'm on Ubuntu Mate);
Put this (one line of) code (thank you, courtesy of switch87 in the previous answer)
sleep 60 && bash -c 'for i in {0..7}; do cpufreq-set -c $i -g performance; done'
into the file in the directory
/etc/rc.local
Mine is a line above "exit 0" and uncommented, under the commented ones.
"rc.local" for those who do not know, it runs the command as sudo. Any command it seems, to change the governor, needs to be run as sudo.
It lets the governor reset back to powersave and runs the code as sudo after 60 seconds to change it back to performance.
Change the "60" (in the code you copy) to whatever time (in seconds. 60 = 60 seconds= 1 minute) you need to delay the command and "performance" (in the command part) to what governor you want it to change to.
Out of my hours and hours of searching I have not found a more permanent fix for this than this.
I figure what's a couple of minutes that it's on powersave if this is the best fix I've found, right? Right.
Not the best fix, but it makes it somewhat permanent after it does it's little switch to powersave thing. If you want to boot right up and jump into a game or something you're going to have to wait a minute for the code you just put in to switch it back from powersave or lower the timing on it (depending on how long it takes everything to start up so it'll switch back to performance correctly).
And, as always, to revert back to default (I've seen some issues with people's PCs overheating which is why they might have defaulted it to powersave in the first place) just remove the code from rc.local and reboot or switch it back manually with your cpu icon indicator switcher or run;
sudo /etc/init.d/cpufrequtils restart
in the terminal and or reboot.