Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^2: PL_strtab/SHAREKEYS and copy-on-write leak

by eserte (Deacon)
on Aug 16, 2018 at 13:44 UTC ( #1220438=note: print w/replies, xml ) Need Help??

in reply to Re: PL_strtab/SHAREKEYS and copy-on-write leak
in thread PL_strtab/SHAREKEYS and copy-on-write leak

Note that if you disable the shared key hash, then every object will use its own storage for every hash key. For example if a process creates 1000 objects, each being a hash with the same fixed set of keys (but differing values of course), then that process will store 1000 copies of each key.

But on the other hand, using shareable keys on data hashes where sharing is unlikely gives you overhead. If Devel::Size is correct then sharing a key adds 24 bytes.

Maybe it would be nice if it was possible to decide per-hash whether to share keys or not. Or even nicer, if perl objects wouldn't be based on hashes, then key sharing wouldn't be necessary at all.

  • Comment on Re^2: PL_strtab/SHAREKEYS and copy-on-write leak

Replies are listed 'Best First'.
Re^3: PL_strtab/SHAREKEYS and copy-on-write leak
by dave_the_m (Monsignor) on Aug 16, 2018 at 18:22 UTC
    The plan at some point is to introduce hash vtables. This will allow hashes to have varying implementations, which then opens up such possibilities.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2020-11-23 17:28 GMT
Find Nodes?
    Voting Booth?

    No recent polls found