Nicholas Clark's "Improve Perl 5" grant work

1 Comment

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

1 Comment

Is anything known about performance improvements yet? I'm curious if there's extra speed in these changes as well as memory savings.

About TPF

The Perl Foundation - supporting the Perl community since 2000. Find out more at

About this Entry

This page contains a single entry by Curtis "Ovid" Poe published on March 7, 2006 6:10 PM.

PPI Refactoring Editor was the previous entry in this blog.

YAPC::Brasil::2006 Coming in April is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.


OpenID accepted here Learn more about OpenID
Powered by Movable Type 6.2.2