Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: exists *{$glob} ? (+)

by dragonchild (Archbishop)
on Sep 09, 2004 at 12:00 UTC ( [id://389633]=note: print w/replies, xml ) Need Help??


in reply to exists *{$glob} ? (+)

Yes, I have written code that used more than 4000 classes. I had an application (that's still in use) that needed to support three versions of a communication protocol. Each version had between 3k and 5k messages, with some 1k different components that could be used by a given message. I made every component and every message a different class and maintained them with a bunch of scripts. This was in addition to the 20k lines that I actually maintained by hand.

I've never had the RAM to support 1M concurrent instances of anything (save for ints).

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested

Replies are listed 'Best First'.
Re^2: exists *{$glob} ? (+)
by BrowserUk (Patriarch) on Sep 09, 2004 at 15:33 UTC

    That leaves a couple of questions:

    1. If you were writing the program over, would you use the same strategy of thousands of classes, or might you switch to a more conventional scheme?
    2. Can you imagine writing a program that would use more than 8000 classes and need more than 500k instances of any single class active concurrently?

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      1. As I didn't have a database I could use, then I would definitely use that scheme. Ideally, I would've stored everything in a database.
      2. 8k classes? Yes, in the kind of situation I described earlier. 500k instances? Uhhh ... assuming you used 1k of RAM per instance, which is a lowball estimate, you would need 500M of RAM, just for those objects. If you're doing something that resource-intensive, you probably need it to actually complete running before the Sun dies. So, you're probably not writing it in Perl. Either that or you should've use a database.

      ------
      We are the carpenters and bricklayers of the Information Age.

      Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

      I shouldn't have to say this, but any code, unless otherwise stated, is untested

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://389633]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2024-03-28 12:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found