Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Performance quandary

by dws (Chancellor)
on Feb 23, 2002 at 20:26 UTC ( #147099=note: print w/ replies, xml ) Need Help??

in reply to Performance quandary

Are you sure about this line?   if ( $parent eq "http:/" or $parent eq $key ) {
Is $parent really going to be "http:/" and not "http:" or "http://" (or a complete URL)? Or perhaps do you mean to do something like   if ( $parent =~ /^http:/ or $parent eq $key ) {
The consequence of a false positive on your test is more entries, and thus more runtime.

Comment on Re: Performance quandary
Select or Download Code
Replies are listed 'Best First'.
Re: Re: Performance quandary
by SwellJoe (Scribe) on Feb 24, 2002 at 02:53 UTC
    Yep, this part is correct, I'm pretty sure. What happens during find_parent() is that we strip off one path element and a '/'. So, a URL of becomes This is the Right Thing for the database key to match the Squid key for the same object (a requirement for this program).

    So when we get down to the 'root' element, of, this is the absolute last thing we can have an entry for. One more find_parent will strip the /, leaving http:/, which what I'm checking for.

    Right? I can't skip out on every entry that contains 'http:' because nothing will ever make it to the db. They /all/ have http: as the opener (again, this is so our MD5 hash of the object matches the Squid MD5 of the object--a requirement).

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2015-11-30 17:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (778 votes), past polls