Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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.

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2018-06-18 06:03 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (108 votes). Check out past polls.