Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Perl slower than java (perl 12x faster than Java)

by BrowserUk (Patriarch)
on Dec 11, 2010 at 07:41 UTC ( [id://876569]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        my $gene_length         = gene_length();
    
  2. or download this
    sub gene_length {
        my @gls = ();
    ...
        }
        return ( $gls[0] );
    }
    
  3. or download this
    sub gene_length {
        my $len = length( each %genome );
    ...
        }
        return $len;
    }
    
  4. or download this
    my %genome          = (
        '0001' => '1', '0010' => '2', '0011' => '3', '0100' => '4', '0101'
    + => '5',
    ...
        '1010' => '+', '1011' => '-', '1100' => '*', '1101' => '/'
    );
    my $gene_length = gene_length();
    
  5. or download this
    sub get_nonrandom_chromosome {
    
    ...
        }
        return ($nonrandom_chromosome);
    }
    
  6. or download this
    sub get_nonrandom_chromosome {
        my @scores = map { get_fitness_score($_) } @population;
    ...
            return $population[ $i ] if $temp_score > $rulet_position;
        }
    }
    
  7. or download this
    my %memo;
    sub get_result {
        return $memo{ $_[0] } //= evalExpr( get_phenotype( $_[0], $gene_le
    +ngth ) );
    }
    
  8. or download this
    sub evalExpr {
         local $_ = shift;
    ...
    
         return $_;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-18 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found