Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?

by Joost (Canon)
on Mar 12, 2005 at 14:17 UTC ( [id://438915]=note: print w/replies, xml ) Need Help??


in reply to Re^2: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?
in thread (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?

Hmmm.....
#!/usr/local/bin/perl -w use strict; package CA; use base 'Class::Accessor'; __PACKAGE__->mk_accessors(qw(a b c)); package LA; use Lexical::Attributes; sub new {bless [] => shift} has $.a is rw; has $.b is rw; has $.c is rw; package main; use Benchmark; my %methods = map { my $name = $_; $_ => sub { my $object = $name->new; $object->a(1); $object->b(2); $object->c(3); } } qw(CA LA); timethese (500000, \%methods); __END__ Benchmark: timing 500000 iterations of CA, LA... CA: 10 wallclock secs (10.25 usr + 0.02 sys = 10.27 CPU) @ 48 +685.49/s (n=500000) LA: 7 wallclock secs ( 5.98 usr + 0.00 sys = 5.98 CPU) @ 83 +612.04/s (n=500000)
Doesn't look too shabby to me.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://438915]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found