Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Advice on make my programme faster

by lima1 (Curate)
on Feb 11, 2008 at 20:44 UTC ( [id://667442]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

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

    No recent polls found