On the Blosxom mailing list, Dave Walker asked about ways to profile Blosxom. There were a few suggestions, such as using time or Devel::SmallProf, but neither of those knows anything about how Blosxom works, and can't give information at very useful levels of detail (time isn't detailed enough; SmallProf is actually too detailed -- if all the time's going in Storable, you'd really rather know if it's from calendar or categories).
Frost Back pointed to the MTTimer Movable Type plugin and asked if anybody could port it.
I'm pretty sure the answer is "no" -- the plugin architectures are radically different, and MTTimer's tag-based approach just doesn't make any sense in a Blosxom world. That doesn't mean there aren't other ways of getting good information, though.
Presented here are two (count them: 1, 2 -- yes, two) completely and totally different ways to do Blosxom profiling. They both require Timer::HiRes but are believed to be otherwise dependancy-free.
Pure Plugin Profiling
The first one is for profiling a plugin at a time, and is minimally invasive; it uses a pair of plugins, "timer_start" and "timer_end". These plugins need to be named in such a way that they 'sandwich' the plugin you're interested in; for instance, if you have a plugin named '65wikiwordish' that you want to profile, you'd install these as '64timer_start' and '66timer_end'.
Together, they measure the time used in the sandwiched plugin's start, filter, head, date, story, foot, and end functions, and write the times out to standard error; usually, that will end up going to a log file.
This method isn't able to measure the time in 'entries', 'template' or 'interpolate', nor in the anonymous functions returned by those. As such, it isn't suitable for profiling plugins such as search (which uses entries), flavourdir (which uses template) or interpolate_conditional (which uses interpolate).
The output looks like (all on one line)
TIMER: date:0.003872 end:0.000100 filter:0.001381 foot:0.000099 head:0.000090 start:0.005967 story:0.012366
For best results, leave this running a while to get multiple result sets, rather than assuming the first one you see is representative. See below (after the invasive method) for information on a summarizing tool.
Incredibly Invasive Instrumentation
The second method replaces your whole blosxom.cgi script with one with lots of instrumentation added. It divides the whole Blosxom execution time up into multiple overlapping bits (in this version, 29 plus up to 9 per plugin). The 'instrumentation.txt' file included presents a hierarchical outline of how these bits relate to each other, but you'll likely need to dive into the blosxom.cgi source to figure out exactly what's included n what -- that's okay though, right, since f you aren't comfortable doing that you aren't trying to profile at that level anyway, right? right.
For each plugin, there's a "plugin_whole_name" bit, which includes all the time spent in the plugin, plus one "plugin_function_name" bit for each function the plugin actually uses; these may well be useful even without digging into the other bits.
The output format is the same as for the first method, except it's tagged with "TIMES" instead of "TIMER", and it's much much longer.
Summarizing
The included 'blos-times' script will the output of either of these (or both, comingled, optionally along with other stuff -- ie, it's okay to throw a whole error log at it), and produce possibly useful summary data. For each defined 'bit' it finds, it will display the minimum time, maximum time, total time, and the average time (mean) per run. Someone with more statistical interest than I might want to add median and standard deviation, but what's there is there.
Using
Download, unzip, and use. If you use the alternate blosxom script, make sure to configure it before you install it, and don't erase your real one. The longer you run it, the better the information you'll get from it, but it chews up disk space so keep an eye on it.
No software comes with a guarantee, and this is no different; that said, it's even less supported than most of my plugins, but it's presented in the hope of being useful or inspiring.