/usr/share/doc/libapache2-mod-perl2-doc/docs/2.0/devel/performance/size_matters.html is in libapache2-mod-perl2-doc 2.0.8+httpd24-r1449661-6ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | <?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<ul id="index">
<li><a href="#NAME">NAME</a></li>
<li><a href="#Description">Description</a></li>
<li><a href="#Perl-Structures">Perl Structures</a></li>
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
<li><a href="#Maintainers">Maintainers</a></li>
<li><a href="#Authors">Authors</a></li>
</ul>
<h1 id="NAME">NAME</h1>
<p>Measure sizeof() of Perl's C Structures</p>
<h1 id="Description">Description</h1>
<p>This document describes the <i>sizeof</i> various structures, as determined by <i>util/sizeof.pl</i>. These measurements are mainly for research purposes into making Perl things smaller, or rather, how to use less Perl things.</p>
<h1 id="Perl-Structures">Perl Structures</h1>
<p>Structures diagrams are courtesy gdb (print pretty) and a bit of hand crafting.</p>
<dl>
<dt id="CV---229-minimum-254-minimum-w-symbol-table-entry">CV - 229 minimum, 254 minimum w/ symbol table entry</dt>
<dd>
<pre><code> cv = {
sv_any = { // XPVCV *
xpv_pv = 0x0, // char *
xpv_cur = 0, // STRLEN
xpv_len = 0, // STRLEN
xof_off = 0 , // IV
xnv_nv = 0, // NV
xmg_magic = 0x0, // MAGIC *
xmg_stash = 0x0, // HV *
xcv_stash = 0x0, // HV *
xcv_start = 0x0, // OP *
xcv_root = 0x0, // OP *
xcv_xsub = 0x0, // void (*)(register PerlInterpreter *, CV *)
xcv_xsubany = { // ANY
any_ptr = 0x0,
any_i32 = 0,
any_iv = 0,
any_long = 0,
any_dptr = 0,
any_dxptr = 0
},
xcv_gv = { // GV *
sv_any = { // void *
xpv_pv = 0x0, // char *
xpv_cur = 0, // STRLEN
xpv_len = 0, // STRLEN
xiv_iv = 0, // IV
xnv_nv = 0, // NV
xmg_magic = { // MAGIC *
mg_moremagic = 0x0, // MAGIC *
mg_virtual = 0x0, // MGVTBL *
mg_private = 0, // U16
mg_type = 0, // char
mg_flags = 0, // U8
mg_obj = 0x0, // SV *
mg_ptr = 0x0, // char *
mg_len = 0, // I32
},
xmg_stash = 0x0, // HV *
xgv_gp = { // GP *
gp_sv = { // SV *
sv_any = 0x0, // void *
sv_refcnt = 0, // U32
sv_flags = 0 // U32
},
gp_refcnt = 0, // U32
gp_io = 0x0, // struct io *
gp_form = 0x0, // CV *
gp_av = 0x0, // AV *
gp_hv = 0x0, // HV *
gp_egv = 0x0, // GV *
gp_cv = 0x0, // CV *
gp_cvgen = 0, // U32
gp_flags = 0, // U32
gp_line = 0, // line_t
gp_file = 0x0, // char *
},
xgv_name = 0x0, // char *
xgv_namelen = 0, // STRLEN
xgv_stash = 0x0, // void *
xgv_flags = 0, // U8
},
sv_refcnt = 0, // U32
sv_flags = 0, // U32
},
xcv_file = 0x0, // char *
xcv_depth = 0, // long
xcv_padlist = 0x0, // AV *
xcv_outside = 0x0, // CV *
xcv_flags = 0, // cv_flags_t
}
sv_refcnt = 0, // U32
sv_flags = 0, // U32
};</code></pre>
<p>In addition to the minimum bytes:</p>
<dl>
<dt id="name-of-the-subroutine:-GvNAMELEN-CvGV-cv-1">name of the subroutine: GvNAMELEN(CvGV(cv))+1</dt>
<dd>
</dd>
<dt id="symbol-table-entry:-HvENTRY-25-GvNAMELEN-CvGV-cv-1">symbol table entry: HvENTRY (25 + GvNAMELEN(CvGV(cv))+1)</dt>
<dd>
</dd>
<dt id="minimum-sizeof-AV-3:-xcv_padlist-if-CvXSUB-cv">minimum sizeof(AV) * 3: xcv_padlist if !CvXSUB(cv)</dt>
<dd>
</dd>
<dt id="CvROOT-cv-optree">CvROOT(cv) optree</dt>
<dd>
</dd>
</dl>
</dd>
<dt id="HV---60-minmum">HV - 60 minmum</dt>
<dd>
<pre><code> hv = {
sv_any = { // SV *
xhv_array = 0x0, // char *
xhv_fill = 0, // STRLEN
xhv_max = 0, // STRLEN
xhv_keys = 0, // IV
xnv_nv = 0, // NV
xmg_magic = 0x0, // MAGIC *
xmg_stash = 0x0, // HV *
xhv_riter = 0, // I32
xhv_eiter = 0x0, // HE *
xhv_pmroot = 0x0, // PMOP *
xhv_name = 0x0 // char *
},
sv_refcnt = 0, // U32
sv_flags = 0, // U32
};</code></pre>
<p>Each entry adds <code>sizeof(HvENTRY)</code>, minimum of 7 (initial <code>xhv_max</code>). Note that keys of the same value share <code>sizeof(HEK)</code>, across all hashes.</p>
</dd>
<dt id="HvENTRY---25-HeKLEN-1">HvENTRY - 25 + HeKLEN+1</dt>
<dd>
<pre><code> sizeof(HE *) + sizeof(HE) + sizeof(HEK)</code></pre>
</dd>
<dt id="HE---12">HE - 12</dt>
<dd>
<pre><code> he = {
hent_next = 0x0, // HE *
hent_hek = 0x0, // HEK *
hent_val = 0x0 // SV *
};</code></pre>
</dd>
<dt id="HEK---9-hek_len">HEK - 9 + hek_len</dt>
<dd>
<pre><code> hek = {
hek_hash = 0, // U32
hek_len = 0, // I32
hek_key = 0, // char
};</code></pre>
</dd>
<dt id="AV---53">AV - 53</dt>
<dd>
<pre><code> av = {
sv_any = { // SV *
xav_array = 0x0, // char *
xav_fill = 0, // size_t
xav_max = 0, // size_t
xof_off = 0, // IV
xnv_nv = 0, // NV
xmg_magic = 0x0, // MAGIC *
xmg_stash = 0x0, // HV *
xav_alloc = 0x0, // SV **
xav_arylen = 0x0, // SV *
xav_flags = 0, // U8
},
sv_refcnt = 0, // U32
sv_flags = 0 // U32
};</code></pre>
<p>In addition to the minimum bytes:</p>
<dl>
<dt id="AvFILL-av-sizeof-SV">AvFILL(av) * sizeof(SV *)</dt>
<dd>
</dd>
</dl>
</dd>
</dl>
<h1 id="SEE-ALSO">SEE ALSO</h1>
<p>perlguts(3), B::Size(3),</p>
<p>http://gisle.aas.no/perl/illguts/</p>
<h1 id="Maintainers">Maintainers</h1>
<p>Maintainer is the person(s) you should contact with updates, corrections and patches.</p>
<ul>
<li><p>Doug MacEachern <dougm (at) covalent.net></p>
</li>
</ul>
<h1 id="Authors">Authors</h1>
<ul>
<li><p>Doug MacEachern <dougm (at) covalent.net></p>
</li>
</ul>
</body>
</html>
|