In perl.git, the branch smueller/sort has been created <http://perl5.git.perl.org/perl.git/commitdiff/eecaaa3be03305c4c1e213a356e1f4e42885c918?hp=0000000000000000000000000000000000000000>
at eecaaa3be03305c4c1e213a356e1f4e42885c918 (commit) - Log ----------------------------------------------------------------- commit eecaaa3be03305c4c1e213a356e1f4e42885c918 Author: Steffen Mueller <smuel...@cpan.org> Date: Fri Nov 18 08:08:11 2011 +0100 Some tests for the sort deref optimization Specifically in the context of overloading. M t/op/sort.t commit e3d55efe5002dbd6951269dc91b978c6352d0edd Author: Steffen Mueller <smuel...@cpan.org> Date: Thu Nov 17 14:11:07 2011 +0100 FIXME this can't go into blead as is Implements special-purpose sort functions that do array-dereferencing. This change implements { $a->[0] <=> $b->[0] } and { $a->[0] cmp $b->[0] } for all of numeric, integer, and string sorts. It supports overload magic inner SVs (see tests added in next commit). I believe it also handles the locale cmp case in the same way as the normal comparison does, but since I don't properly understand locales, the tests don't cover that. The net effect of this is a speed-up by over 2x on my machine when doing a Schwartzian transform or similar technique involving sorting on the first element of an array. I tried a variety of array sizes. M embed.fnc M embed.h M op.c M pp_sort.c M proto.h commit 109848307bacdf65db9e41bf993ca0398d6d249c Author: Steffen Mueller <smuel...@cpan.org> Date: Tue Nov 15 18:51:15 2011 +0100 FIXME this can't go into blead as is This implements detection of a basic Schwartzian transform-style sort block and removes it from the OP tree. It sets a new flag on the sort OP which will indicate that this sort needs to be performed by one of the special-case optimized C functions in pp_sort. The actual implementation of that function is pending. M embed.fnc M embed.h M op.c M op.h M proto.h commit ad0d661cbdf464b07dc9f602f47ea7ddc0695dde Author: Steffen Mueller <smuel...@cpan.org> Date: Mon Nov 14 20:50:41 2011 +0100 Rename variable for clarity M op.c ----------------------------------------------------------------------- -- Perl5 Master Repository