Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by Anonymous Monk
on Mar 12, 2005 at 14:01 UTC ( [id://438913]=note: print w/replies, xml ) Need Help??


in reply to Re: (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?

Ever benchmark inside out objects? It can't be good
  • Comment on Re^2: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?

Replies are listed 'Best First'.
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
    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://438913]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-26 05:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found