Modifying the speed at which a process runs ( Cheat Engine alternative as a Flash Game Speed Hack)
These might help with slowing processes down, but not speeding them up...
1) SIGSTOP and SIGCONT:
The kill
command can issue a STOP
and a CONT
signals to a process with a given pid.
I've used it for 'pausing' and 'throttling' python scripts before, and it works fine for that purpose.
Here's an example in a bash script (pass in the PID of the relevant process as the commandline parameter):
PID=$1
while true; do
sleep 0.5
kill -s STOP $PID
sleep 0.5
kill -s CONT $PID
done
Those sleeps (in seconds) would need to go down to a much smaller amount to reduce jerkiness, but the bigger interval makes it more obvious for testing.
Once your happy with a particular interval, you could make the ratio of sleeps adjustable with a variable.
2) One other possibility, for throttling, is 'cpulimit':
sudo apt-get install cpulimit
To limit firefox to 30% CPU:
cpulimit -e firefox -l 30
Short answer, no. There's no 2x button for process scheduling. Best you can do is use cgroups for what you're interested in to get more CPU time, at the expense of another process. If I had to guess, the reason speedhack even works is because it's doing it's business by manipulating the flash runtime, or just call it a virtual machine. It's not that it's speeding up the program, it's changed fundamental parameters the whole VM is based on. I suppose the same thing would be possible with something like Java or Python.
Oh well, I guess you'll have to continue cheating on farmville on Windows. Shame.