http://qs321.pair.com?node_id=667442


in reply to Advice on make my programme faster

move
my $obj = $Measure->new($wn);
before the for loop (Update: suaveant already mentioned this, sorry).

Check your word list. Does it contain duplicated lines (you should never have to use Memoize)? Try this to spot errors:

sub similarity { my ( $w1, $w2 ) = @_; warn "'$w1' vs '$w2'"; return $obj->getRelatedness($w1, $w2); }

Replies are listed 'Best First'.
Re^2: Advice on make my programme faster
by smilly (Novice) on Feb 11, 2008 at 21:27 UTC
    thanks good advice for moving $obj from the loop.