Nicholas Clark's "Improve Perl 5" grant work
Tue, 07-Mar-2006 by
Curtis "Ovid" Poe
edit post
I have just received the first report for Nicholas Clark's grant. So far, things are going rather well. Read on to see what Nicholas has done.
I've completed the planned typeglob (PVGV) structure shrinking. This turned
out to be somewhat more complex than I expected. Specifically:
- Discovered that PVGVs use magic to perform stringification. Removed this
need for magic, saving 24 bytes.
- Discovered that pads use PVGVs for storing C variable names. Changed
C variables to be stored in PVMGs
- Moved the GP pointer to the SV head structure, saving 1 level of
dereferencing (and 4 bytes)
- Managed to merge in all the other fields of PVGVs into the fixed part of SV
structure common with all the smaller SVs. (saves 16 bytes)
- Change from storing the GV's name in a string to using a sharing the hash
key structure used by the symbol table holding this typeglob. (saves the
length of the typeglob name) [sizes for systems with 4 byte pointers and longs,
such as x86 and default PPC]
I think this roughly halves the size of PVGVs. For an example, the
installman script in the perl source tree uses over 1200 PVGVs, so
this saves about 50K.
PVLVs had no magic associated, but benefit from all the other savings.
I've completed the planned PVCV and PVFM shrinking. Both are now about 25%
smaller (eg 20 bytes). installman uses 600 PVCVs, so this saves about
12K
Comments (1)
Is anything known about performance improvements yet? I'm curious if there's extra speed in these changes as well as memory savings.