Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: flattening Complex Datastructures

by demerphq (Chancellor)
on Feb 10, 2003 at 19:36 UTC ( #234217=note: print w/ replies, xml ) Need Help??

in reply to flattening Complex Datastructures

Another con is that extracting the keys() or values() for only one path will be extremely slow.

Generally speaking I think the cons outweigh the advantages. If memory overhead really is an issue then there are other solutions available. For instance it is fairly common to use hashes as records/structs. When the records are well defined and unlikely to change then an array will do just as nicely, and allows faster look ups and is more efficient in terms of memory.

I would say that if a program suffers from problems that would be alleviated by your proposal that there are other algortihmic and data structure changes that can be implemented, most likely with a net postive effect on the program even discounting memory issues.

--- demerphq
my friends call me, usually because I'm late....

Comment on Re: flattening Complex Datastructures

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2016-02-08 05:06 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (268 votes), past polls