Skip Menu |

This queue is for tickets about the CGI-Application-Plugin-TT CPAN distribution.

Report information
The Basics
Id: 64573
Status: new
Priority: 0/
Queue: CGI-Application-Plugin-TT

People
Owner: Nobody in particular
Requestors: MARKSTOS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.05
Fixed in: (no value)



Subject: performance suggestion: cache package data in the application object
Cees, I emulated the package-variable handling logic in this in CGI::Application::Plugin::Config::Perl, so I can avoid reading the config file only once per request in persistent environments. In benchmarking variations of my own code, I found a design change which I think would apply to this as well (although I haven't benchmarked this plugin). The optimization I made was to cache the packaged-stored data in the CGI::Application object, so that repeated requests for the stored data are found quicker. This probably matters more for a config plugin, which may get several calls to config() over the course of the request, while the TT plugin may get only one tt_process(). In my plugin, it was a 40x improvement for calls to config(). The recipe was simple: At the place that data is set in the package, also set it in the application object.