in reply to Re: Perl Objects, Internal Representation -- How??
in thread Perl Objects, Internal Representation -- How??
"Why" is simple and should be obvious-- I have an application that uses a lot of object instances and I am looking to optimize it and improve its efficiency in terms of both memory and execution speed.
However, I can and will be happy to elaborate on my application a bit...
I have been tasked to write (and in some instances, re-write existing) programs to process very, very large log files from across a number of systems and derive detailed "stats" (info) from the logs. These systems are in heavy use 24/7/365. I have examined the problems from a number of angles and have developed a number of strategies for handling the job. The most obvious and useful one is to crunch the stuff offline on another unencumbered machine.
One of the older programs (which I didn't write) from a much older system often has problems bumping up against the 2GB limit built into the perl binary. Unfortunately I am not permitted to compile up a new binary, nor do I have access to a binary with a larger limit. And the system has reached "end-of-life" in every possible, conceivable measure of the term, and is on "ICU life support" and we're just hoping it can make out the year without problems... so the likelyhood of actually fixing that one is somewhere between positive zero and negative zero...
In the new initiative... in my earlier attempts, I sometimes ran up against the 2GB limit with the new programs too. However through careful (re-)consideration of the data and limiting myself to only the barest essential data that I need from each log entry, I have been able to cut back considerably on the in-memory requirements and haven't hit the limit in awhile.
One of the things that compounds my efforts is that I have to combine logs from multiple systems (i.e. a sequential stream) in order to develop complete records. And there are multiple systems (wide) at each point in the path. So in order to follow a trail for a particular item, I have to follow the chain of systems, whichever ones they may be. And that ultimately takes quite a bit of crunch time to sift through all the data.
In the end-- all this will be easier. I am developing a database that we will ultimately use to just write the data into in the first place and then it should mostly just "fall out" the right way when queried. Until then however, management has deemed it important (nay, critical :) that I crunch the data, develop the stats, and generate reports __before__ I work on putting it into the database (where, ironically, generating the reports and such would become virtually trivial...
...Did I mention how much I _love_ my job??? :)
I am nearing the end of this first phase. Things are working out pretty well. But I have been curious of late just how well perl stores objects-- how effectively and efficiently. What optimizations it performs. Are there any attempts to cut down and reduce redundancy and overlap in the keys (since that could add up to a blivet of memory all by itself!) And etc-- what else I can do to squeeze out space and cycles.
I have also been recently reading and schooling myself in the various manners in which one could create objects-- arrays, scalars, etc. and have read a bit about inside-out objects, but don't see how they really reduce the cost of memory.
All-in-all, I very much like Perl's ability to do what I want-- to make the simple things simple and the hard things possible... (I think I've heard that somewhere... :) But there are times that I wish it had a mechanism to permit hard-typing and struct-based objects.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl Objects, Internal Representation -- How??
by chromatic (Archbishop) on Sep 17, 2006 at 02:54 UTC | |
|
Re^3: Perl Objects, Internal Representation -- How??
by BrowserUk (Patriarch) on Sep 18, 2006 at 06:16 UTC | |
|
Re^3: Perl Objects, Internal Representation -- How??
by Anonymous Monk on Sep 21, 2006 at 08:59 UTC |