[JOB] Perl Software Developer and Database programmer

Jacqui Caren jacqui.caren at ntlworld.com
Wed Feb 22 22:36:32 GMT 2006


> Ovid proposed:
> 
>>  Imagine we're building an app and it turns out to be slow.  We've
>>  profiled the code and reduced the problem down to this:
>>
>>    foreach my $alpha ( @alphas ) {
>>        foreach my $beta ( @betas ) {
>>            if ( $alpha == $beta ) {
>>                push @results, $beta;
>>            }
>>        }
>>    }
>>
>>  1.  What is a likely reason for the performance problem?
>>  2.  How might we speed it up?

another option:
Put the effing thing in a database :-0

now we can move onto why

select distinct A.id from alpha A, beta B where A.id = B.id

is the SQL equivalent of the above perl example.

Jacqui




More information about the london.pm mailing list