Perl 5.14 released
news.perlfoundation.org
news.perlfoundation.org
There's a lot going on here, but a couple jump out at me:
* Non-destructive substitutions (with a new 'r' option)
* An experimental feature that allows you to perform operations like push, pop, splice, keys and company directly on (unblessed) array and hash references. (There's a pretty strong warning that this feature is subject to change.)
There are also enhancements for Unicode, regular expressions, exception handling and more.
my @list = (... stuff ...);
my @other_list = map { s/SOMETHING//; $_ } @list;
(The result of this is that @other_list and @list are equal because the substitution destructively affects the original list.)(Incidentally, perlcritic will warn you if you have a map that modifies $_.)
my $old = "foo"; my $new = $old =~ s/foo/bar/r;
$old still contains "foo" and $new contains "bar", but inside a map should be great as well.Have you checked if both your old and the new perl have the same threading settings?
I expected some performance improvements from the upgrade, but I found 20% to be pretty surprising -- still I won't complain :-)
The noted speed improvement is for a hefty Catalyst + DBIC + Moose app. Also seen similar performance improvements in a smaller Dancer app we have. Maybe it's related to the BUFSIZ changes.
Perl 5 releases a new major version every year, and a new development version every month. So 5.16 will be around next spring, and 5.18 will be around the spring after that.
With thousands of users around the world, Perl 5 is not going away any time soon.
Both move along nicely, and Perl 5 gets many inspirations from Perl 6 - not the least of it is a time-based release schedule, which is why you see many more releases of Perl 5 in the last two years.
* perl5 was always a 2-4 times faster than than ruby 1.8
* perl5 & ruby 1.9 are comparable usually swapping places on different "Which programming languages are fastest?" benchmarks
* When taking in above speed benchmarks, memory used & code-used then perl5 just nudges in front of ruby 1.9. See "Which programming language is best?"
Perl 5.14, Dancer 1.3040, HTTP::Server::PSGI:
Requests per second: 856.48 [#/sec] (mean)
Memory after tests: 11296 (VSZ) 7632 (RSS)
Ruby 1.9.2, Sinatra 1.2.6, WEBRick 1.3.1: Requests per second: 402.72 [#/sec] (mean)
Memory after tests: 20612 (VSZ) 10628 (RSS)
I know. This is not, by any means, serious language benchmarks (ie. Sinatra, WEBRick, Dancer are interfering), but they give me a rough idea of how things can perform side-by-side for a given setup.I'm also a fan of running quick string management tests to roughly benchmark interpreters at a given servers, since most of our codebase do a lot of string manip. Here's a 1MB mem alloc + cat test:
Ruby 1.9.2:
$ time ruby -e 'x=""; (1..999999).each { x << "a" }'
real 0m0.313s
user 0m0.277s
sys 0m0.026s
Perl 5.14: $ time perl -E '$x.="a" for 1..999999'
real 0m0.167s
user 0m0.139s
sys 0m0.020s
As I said, this is completely unscientific. There are much better ways of benchmarking languages out there.It just seems really silly ;-)