dd-b has asked for the wisdom of the Perl Monks concerning the following question:
So, now that I know why my picpage module is actually running slowly, I need to do something about it. (Originally Startup cost, CGI performance, continued in CGI to Apache::Registry, or to mod_perl
The module displays one photo from a photo gallery, with title, description, comments, navigation links to previous and next photos in the gallery, that kind of thing. It's to run in a non-database environment.
Currently it gets most information from a YAML file written out by the galpage script, which generates the thumbnail page for the gallery (not dynamically) after reading up the previous YAML file, looking at all the image files in the directory, checking for .name and .info files associated with the image files, and generally thrashing around a lot.
Part of the complexity is dictated by galpage being intended to replace a previous dynamic solution; it needs to read the same files that used, and incorporate them into the YAML for the future. It's also necessary for me to edit the YAML file manually -- the new way of doing things is to run galpage on a directory with just the image files, then edit into the YAML file the titles and such. This, I might add, is a solution intended for me, not something to be turned over later to users.
In large directories, it turns out that reading the YAML is the largest component of the time spent by picpage (2.5 seconds, against the next largest chunk being smaller than .01).
I'm trying to reject the solution of writing a binary file (which should then be readable with far less parsing), because that would require creating an application to do that manual editing in the binary file, which would be a huge amount of work and provide a much less pleasant interface to editing the data in the file (I'm an emacs user; 'nuff said).
So I see two classes of solutions:
So, are there modules to suggest? I remember that HTML::Mason has a very nice caching system, which isn't actually specific to Mason, for example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Big config file reading, or cross-process caching mechanism
by merlyn (Sage) on Jan 17, 2004 at 18:49 UTC | |
by dd-b (Pilgrim) on Jan 17, 2004 at 19:50 UTC | |
by merlyn (Sage) on Jan 17, 2004 at 19:59 UTC | |
by perrin (Chancellor) on Jan 17, 2004 at 19:58 UTC | |
|
Re: Big config file reading, or cross-process caching mechanism
by toma (Vicar) on Jan 17, 2004 at 21:57 UTC | |
|
Re: Big config file reading, or cross-process caching mechanism
by waswas-fng (Curate) on Jan 18, 2004 at 01:12 UTC |