Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: Cloning shared hashref

by menth0l (Monk)
on Jan 21, 2011 at 08:12 UTC ( #883484=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Cloning shared hashref
in thread Cloning shared hashref

Thanks. I wrote something similiar by myself but i hoped i would find somthing faster than pure perl cloning i.e. XS-implementation...


Comment on Re^4: Cloning shared hashref
Re^5: Cloning shared hashref
by BrowserUk (Pope) on Jan 21, 2011 at 08:39 UTC

    Actually, I think that a pure perl solution is both the right and probably fastest solution to this.

    The problem with the XS implementations is that they are trying to create exact duplicates of the original structures, including any attached magic. Their problem with shared structures is that they were implemented before the shared magic was, and they've not been updated to handle it.

    But for your purpose, you need to explicitly remove that shared magic, which the pure perl cloning does. But as it doesn't have to try and replicate that magic and all the structures and possibilities associated with it, it will likely be faster than an XS implementation that did.

    Which given that you don't want it, is a win-win.


    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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2014-11-27 11:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (184 votes), past polls