in reply to Re^2: Size of inside out object
in thread Size of inside out object

For your given example, both will require two hashes, each with 2 of the 8 slots used. As near as make no difference, the memory usage will de identical for both.

However, lets say you have 10 instances of a class that has 2 attributes:

  1. Classical: 10 hashes with 2 of 8 slots used ~ 80 hash slots + 20 scalars + 10 hash headers.
  2. Inside out: 2 hashes each with 10 of 16 slots used ~ 32 hash slots + 20 scalars + 2 hash headers.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^4: Size of inside out object
by cheekuperl (Monk) on Jun 06, 2012 at 03:08 UTC
    Thanks! I'll have to research more, but I got what I needed to know!!