in reply to can a perl script act as a daemon to serve data in its symbol table?
I'm not entirely sure I understand what you're trying to do here, but it seems like you're trying very hard to recreate a filesystem :-).
If you've got a decent database system and OS as well as enough RAM, data for the most recent queries will likely still be in the OS's disk cache, which is in RAM. So access to that through the database will not be horrenduously slower than access to a cached version in memory. On the other hand, the overhead of managing your cached data, making sure it's still current, searching through it and expiring it sensibly will likely be quite considerable and could very well use up more system time than you gain (as well as being a good place for subtle bugs to nest). I'm not saying such a solution is generally bad, it could be very sensible if done well and make your application perform better. But it sounds as if you're optimising prematurely. You should probably finish your application, properly abstracting your data access so that you can add caching later, then profile and optimise at that stage.
All that being said, take a look at Memoize, it may be a quick and simple way of doing what you want. And for reusing opened DBI connections, look at Apache::DBI.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: can a perl script act as a daemon to serve data in its symbol table?
by leocharre (Priest) on Feb 02, 2006 at 02:36 UTC | |
by tirwhan (Abbot) on Feb 02, 2006 at 08:53 UTC | |
by leocharre (Priest) on Feb 02, 2006 at 17:53 UTC | |
by tirwhan (Abbot) on Feb 02, 2006 at 18:15 UTC |