I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-08-31 14:45:29-07 by szabgab
Improving performance

Some of the pages of CPAN::Forum take as much as 5-15 seconds to load.
I added the following line to the cgi script to see what's going on.

BEGIN { $ENV{DBI_TRACE}='1=/tmp/dbitrace.log'; }

After some digging in the output I see a single page view can generate 10s of queries. especially those that show a full thread. The one I checked generated 48 queries.

By adding all the fields of tha posts table to the Essential columns, I could elimnate the repeated query of the post table for each entry. That brought me down to 30 queries.

__PACKAGE__->columns(Essential => qw/id gid uid parent subject text date thread hidden/);

The problem is that for each entry I call $post->id->username and each such call generates another request to the database.
How could I tell CDBI to load the username field from the users table as well while fetching the posts?

Direct Responses: Write a response