in reply to Re^4: Completeness of Devel::Size answers
in thread Completeness of Devel::Size answers
That is interesting. Horribly inefficient, but interesting :)
Also, as noted, the tracking hash in Devel::Size doesn't only detect cycles, but also prevents data structures and subtrees that are referenced from 2 (or more) places in the overall structure from being counted multiple times. This isn't just required to detect repetition in the structure at the user level, but also in the internal structures. For example, internally, some hashes can share keys, and the same hash mechanism is used to prevent the memory for shared keys being counted over.
|
|---|