This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Minimise the size of padname + string buffer
authorFather Chrysostomos <sprout@cpan.org>
Fri, 28 Nov 2014 22:35:40 +0000 (14:35 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 30 Nov 2014 19:48:42 +0000 (11:48 -0800)
commit662308654967c8d237f3ee651bae9c27cd9feaa2
tree9b54880a1f2ab9af8a41b57e4fd7b8f63b392a2d
parent93fa278758aa71f9c91078585c82898a9c7b8eb6
Minimise the size of padname + string buffer

If we define the struct a little differently, we can begin the string
buffer two bytes into a pointer, rather than pointer-aligned.  In case
some platforms can compare pointer-aligned string faster, I added a
#define to allow that.  But on 64-bit darwin the speed is identical
either way:

$ time ./miniperl -e 'eval q|my$a;|x50000 . q|eval q<my $A>|'

I ran this three times in each mode, and the average of the user times
differed by less than 1%.
pad.h