Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^8: Perl memory usage

by kscaldef (Pilgrim)
on Sep 02, 2005 at 17:30 UTC ( [id://488720]=note: print w/replies, xml ) Need Help??


in reply to Re^7: Perl memory usage
in thread Performance, Abstraction and HOP

I said "generic" tree, along the lines of a glib GTree. So, there's an extra pointer to the data:

struct Node { gpointer data; struct Node *left; struct Node *right; }

So, 3 (probably 4 byte) pointers, plus the data pointed to.

The perl implementation, though, is not a simple struct. Instead, the three members are SVs in an array, and an SV is significantly larger than a single pointer. Then there's some additional overhead for book-keeping on the array.

Replies are listed 'Best First'.
Re^9: Perl memory usage
by Anonymous Monk on Sep 02, 2005 at 17:48 UTC
    If anyone out there is in the know, I'd still be interested how you get from the ~76 byte guesstimate, to the 112 byte answer. There must be some low-level document somewhere where it is explained (or maybe a pointer to a chunk of code). I'm still looking at PerlGuts Illustrated. And I think we can all agree that a less bloated way to represent trees in Perl6 would be nice. Right?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-19 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found