Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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....

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://234217]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2017-05-25 03:57 GMT
Find Nodes?
    Voting Booth?