I noticed that on tilde.town users with a high botany score used up a
lot of CPU cycles. I skimmed through the code and didn't immediately see
any tight loops, but after profiling against a user's borrowed .botany
directory I saw the culprit: the score increase thread.
This thread was designed to increase the user's score by 1 every time
the thread did an iteration of its infinite loop. It would sleep for an
interval scaled *down* based on how high a user's generation bonus was.
This meant that the sleep interval trended towards zero, creating a
tight loop for high scoring users.
This commit changes the code to use a constant sleep inteveral but scale
the score increment *up* based on generation.
I also removed the death check thread entirely since we were already
checking for death in the score thread. I also short circuited the death
check.
This had the effect of reducing CPU load for a high scoring user by a
factor of about 50.