3 ms·
> Here’s an example of one of the scripts that generates the attendance report: echo "<H2>Registrations: <B>" `ls | wc -l` "</B></H2>" echo "<CODE>" echo
by kazinator 7y ago
> Here’s an example of one of the scripts that generates the attendance report:
echo "<H2>Registrations: <B>" `ls | wc -l` "</B></H2>"
echo "<CODE>"
echo "Authors: <B>" `grep 'Author = Yes' * | wc -l` "</B>"
echo "<BR>"
echo "Non-Authors: <B>" `grep 'Author = No' * | wc -l` "</B>"
echo "<BR><BR>"
> This script is slow and inefficient, particularly as the number of registrations increases, but not least among its virtues is the fact that it works. Were the number of attendees to exceed more than around one hundred, this script would start to perform so badly as to be unusable.
I'm not entirely buying it; I remember what performance was like in 1995, and grepping a hundred or so small files wasn't any sort of big deal, even on consumer-grade equipment like an 80486 running GNU/Linux, even with multiple users hammering on that CGI server to obtain the above output.
In any case, the logic could easily be rearranged so that the output of exactly the same code as above is cached as static HTML, which is regenerated only when the set of registration files is altered.
So if the registration exploded and the machine got bogged down with multiple instances of these slow scripts, there would be no need to change the actual code, just to plug it into the overall solution in a different way.