We've been working on some enhancements to Radio's upstreaming
implementation, which make it much more CPU-friendly. We're releasing
the changes here as a beta, so we can flesh out any problems before
releasing through the root updates process.
*** How to test:
1. Download the new parts here:
http://jake.userland.com/gems/upstreamPerfFixes03.fttb
2. Using the Open command in Radio's File menu, open the downloaded
file and click OK to all confirmation dialogs.
3. In the table window that opens after importing the file, run the
install script to install the changes.
4. Make a new post, edit an existing one, create a new story, and
verify that the files are upstreamed as normal.
5. Send a note to radio-dev and let us know how it's working. You
should see much less CPU usage by Radio, especially when Radio is idle,
and no significant change in responsiveness when creating or editing
posts or stories.
*** What are the changes?
There are two primary changes and a few smaller ones:
First, when Radio scans your www folder looking for new or changed
files to upstream, it keeps track of how long it's been since a file
was upstreamed from within a given sub-folder. If it's been more than a
minute, then Radio will only scan for changes in that sub-folder once a
minute. If it's been more than an hour, then Radio will only scan the
sub-folder once every five minutes. Files in the top-level of the www
folder are always scanned once every 10 seconds, to give priority to
your home page and RSS feed.
We also noticed that when scanning for deleted files, Radio was using a
large amount of CPU time. The scan now yields a tick (1/60 sec) of CPU
time for every 5th file when scanning for deletions. In addition, Radio
will only scan for deleted files once every five minutes instead of
once every 10 seconds.
Together, these two changes greatly improved Radio's CPU profile. In my
testing on a 500MHz G3 running MacOS X, Radio's CPU usage went from
about 70-80% to about 15-20%. A similar performance difference was
noted in the lab on Windows.
A more minor change to the scan for new or changed files prevents files
within folders containing an upstream spec of type "none" from being
scanned. This includes the www/system/ sub-folder and most Tool
sub-folders.
Other changes were made to force Radio to scan archive sub-folders,
story sub-folders, and the images sub-folder immediately, when an
archive file, story or image needs to be upstreamed. This should keep
upstreaming as responsive as it was previously, when editing your site
through the desktop website or the Meta-Weblog or Blogger APIs.
If you have any questions, comments or bugs to report, please send
email to the radio-dev mail list.
Thanks!
-Jake