in reply to Re^2: Your favorite objects NOT of the hashref phylum
in thread Your favorite objects NOT of the hashref phylum
I just wanted to make a comment that many systems do just deal with a relatively small number of objects at once - most web based systems for example.
I once used an in-house object system similar to what Moose sounds like, but with even more features and overhead (it also included automatic RDBMS mapping etc). It worked fine in the web based system, but then we had to make some batch jobs using the same objects for migration. We had a few hours to build, modify and then tear down hundreds of thousands of objects.
The system was too slow - it was going to take about 2 days! But wait - theres more! I spent a few days profiling the code and came up with a few smallish changes. I tweaked the most used methods to use more efficient mechanisms. Some methods were being run literally millions of times - in those cases I threw niceness to the wind and removed lexically scoped variables, reached into objects bypassing accessors etc. The were mostly small methods and I made up for the ugliness with large wads of code comments and POD to ensure that the code remained maintainable.
2 days of execution then became 2 hours. I also did some major tweaking on the RDBMS side, but at least half of the performance gain was due to the perl code changes.
My point is that you should normally not throw out a code model that benefits your developers because of concerns with future scalability. Unless the model is stupid there is usually a way to make it fast after the fact. This is not always true in other languages where you are contstrained in your options, but in Perl there is always a way to optimise more. If you really need to, you can do wacky things like manipulate the runtime tables or rewrite your most often used methods in XS, but I've never had to do that (which is a pity because it could be fun).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Your favorite objects NOT of the hashref phylum
by BrowserUk (Patriarch) on Mar 27, 2006 at 11:03 UTC | |
Fun with Farcical Factories (Was: Re^4: Your favorite objects NOT of the hashref phylum)
by aufflick (Deacon) on Mar 28, 2006 at 13:56 UTC | |
by BrowserUk (Patriarch) on Mar 28, 2006 at 14:37 UTC | |
by aufflick (Deacon) on Mar 30, 2006 at 12:15 UTC |