Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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
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 http://www.url.com/path/element becomes http://www.url.com/path. 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 http://www.url.com, this is the absolute last thing we can have an entry for. One more find_parent will strip the /www.url.com, 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-08-30 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls