chanakya has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks
Currently I am rewriting a bunch of perl scripts to improve performance and used couple of frameworks. One of them is Log::Log4perl
I have 20 perl scripts and one issue I have observed is, everytime a new script executes, a new Log4perl object is created. My idea is to create one Log4perl object and reuse the cached object across all the other scripts to save time in creating new object every time.
To achieve the above I was thinking about:
* Caching the Log4perl object once its created by the first script
* Other scripts use the cached object or it cached object is expired, instantiate the Log4perl object .
I'd like to know what Caching modules will help me achieve this, and also let me know if my approach is correct.
Thank you for your time
Currently I am rewriting a bunch of perl scripts to improve performance and used couple of frameworks. One of them is Log::Log4perl
I have 20 perl scripts and one issue I have observed is, everytime a new script executes, a new Log4perl object is created. My idea is to create one Log4perl object and reuse the cached object across all the other scripts to save time in creating new object every time.
To achieve the above I was thinking about:
* Caching the Log4perl object once its created by the first script
* Other scripts use the cached object or it cached object is expired, instantiate the Log4perl object .
I'd like to know what Caching modules will help me achieve this, and also let me know if my approach is correct.
Thank you for your time
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Caching Log4Perl object and using in various scripts
by marto (Cardinal) on Sep 14, 2009 at 13:12 UTC | |
by dinomite (Sexton) on Sep 15, 2009 at 05:11 UTC | |
Re: Caching Log4Perl object and using in various scripts
by Anonymous Monk on Sep 14, 2009 at 12:43 UTC |
Back to
Seekers of Perl Wisdom