in reply to RE: RE: Re: Complex Hash
in thread Complex Hash

Yes, but the combination is not what matters. Its almost a red herring. In fact, I'm not even using that ability (yet), I merely provided for it in case I needed it. (and if I find that I don't I will probably take it out.)

What is bothering me is that I have to check every key until I find the match, starting from some arbitrary point. (Arbitrary to me, not Perl) I lose the true advantage of an associative array... the hashing algorithm.

By the way, your quote:
"Please read for comprehension!" -- PurlGurl {grin}
Implies that I didn't comprehend your suggestion. I am offended at your arrogance.

Replies are listed 'Best First'.
RE: RE: RE: RE: Re: Complex Hash
by merlyn (Sage) on Sep 06, 2000 at 04:30 UTC
    Did you read my code? I already turned your second-level linear search into a simple hash lookup. From a O(N*M) operation to a O(N) operation for N categories, M names per category. And then, I'm memoizing that, so it's speed up on any subsequent hits!

    -- Randal L. Schwartz, Perl hacker


    P.S. As for your P.S., you didn't read my code, so my statement is all the more accurate!
      I did read your code, and I did see your first enhancement, but as the majority of your post related to Memoize I responded to that aspect of it. I am increasingly offended by your inability to accept that I might know a little Perl. I am the first to admit that I do not know as much as you, nor anywhere close, but I do not appreciate being talked down to any more then the next Monk.

      You may respond to this at your leisure... I am in no hurry to start an aggravated debate with you. I have not voted -- on any of your posts on this thread, nor am I the kind of person who would. I am also not the kind of person that likes to get into personality debates. I would much rather discuss Perl and Computer Science. Thank you and good night.

        I read every one of your posts carefully. You complained
        That would work well if GetEMailFor() was being called lots of times with the same query, but it isn't. Its being called several times with almost every query being different.
        Which indicates to me that you don't get that it's the individual components of a query that were memorized, not the overall call to GetEMailFor. If you believed contrary, you weren't clear. And when you further buttressed your position, including complaining about my joking PurlGurl reference that you seemed to have missed both dimensions of the speedup (since you acknowledged neither), I became more convinced that you were missing the point.

        Sir, I know nothing (nor presume nothing) of your Perl skill except what you are able to demonstrate here. In fact, to keep things simple, I always presume you know precisely what you demonstrate, and perhaps a little more.

        Do not presume that I "look down" on anyone here. Heck, just today, someone pointed out a CPAN module that I wasn't aware of. I love the ability to exchange info!

        But if you want me to accept that you completely comprehended my previous message, perhaps you could have communicated it in a way that I believed that. In my world, you didn't. I'd love to hear other feedback though.

        -- Randal L. Schwartz, Perl hacker