Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Bidirectional lookup algorithm? (sundialsvc4 spam)

by Anonymous Monk
on Jan 06, 2015 at 20:06 UTC ( [id://1112405]=note: print w/replies, xml ) Need Help??


in reply to Re: Bidirectional lookup algorithm? (Updated: further info.)
in thread Bidirectional lookup algorithm? (Updated: further info.)

mike robertson it isn't reasonable or polite to keep spamming BrowserUk like this, why is sundialsvc4 such a constant spammer? Its unprofessional to be a spammer mike robertson.

Replies are listed 'Best First'.
Re^3: Bidirectional lookup algorithm? (sundialsvc4 spam)
by sundialsvc4 (Abbot) on Jan 07, 2015 at 14:26 UTC

    Yes, that is my name.   But, pardon me, you don’t seem to be using yours.   Wonder why.   Nevertheless, all of this is entirely off-topic.   I believe that someone asked a question about bidirectional lookup algorithms, yes?

    Returning to the topic, then, if you really want to attempt to use a single indexing scheme to locate two keys, the only way that I know of to do this is to generate a synthetic key, within the same domain of values, for each key that you wish to store.   You then employ a hashref keyed by this synthetic-key.   Each bucket in this hashref points to an arrayref of references.   You insert a reference to the (single ...) record into this hashref/arrayref structure multiple times, one for each synthetic key.   Searching now involves retrieving the arrayref for either key, and iterating through it to find the actual record(s) that you want.   The synthetic-key and constrained domain for that key is merely intended to reduce the size of the hashref:   you will still have a lot of accompanying data-structures ... probably more-or-less equivalent to having two separate hashrefs.

    = = = = =

    But the over-arching problem remains the same:   memory must be presumed to be unlimited and resident.   Either you have that or you don’t.   This strategy continues to be “random.”   It does not exhibit “locality of reference.”   It will produce a very high working-set size that, under production load conditions (really, any sort of virtual-memory stress at all ...) will perform prohibitively poorly, even though it may have seemed incredibly-clever on the developer’s machine, which was never actually “paging.”

    (I like to give developers machines that are memory-tight.   It forces them to write better code, because now they feel it, too.)

    I confess to a little bit of déjà vu here, because I once was called-upon to undo a similar program.   Oh, the thing was a gloriously clever mess.   There was “cleverness” running all through it, and memory-wise it was a big, fat pig.   Pretty much had to re-write the whole thing.   It just couldn’t run.   It acted, as I’ve said, “punch-drunk” when page-faults started hitting it, and of course, page-fault behavior affects everything on the machine.   (Other things, too ... “oh no, don’t call a subroutine!   Subroutines are ‘inefficient!’   It’s ‘faster’ to repeat yourself in-line!”)   A big fat pig mess.   But it sure did look clever to the developer, who by then had conveniently slipped out the door.   Code needs to be fast enough, under production conditions, and it must be maintainable.   That’s all.   Don’t be “too clever by half.”   Please.   Pretty please.

      "Yes, that is my name. But, pardon me, you don’t seem to be using yours. Wonder why."

      It has finally happened, you don't even know your own name any more! This explains the quality of your posts. You don't even read what people post, then reply anyway.

      Update: I do not for one moment believe that you have actually forgotten your own name. A more constructive way to have approached this would have been to point out brown M&M story. In the past I've engaged you on responding to things people didn't say, and in some cases quoting things that nobody has said, to no avail.

        ... This explains the quality of your posts...

        There is no post by this certified asshole that has something like quality (the non-inferiority or superiority of something).

        I'm really disconsolate that i got no more votes tonight. Tomorrow i'll up vote your reply ASAP.

        And i will continue to recommend down voting anything posted by this monk without distinction as a good default policy.

        Update: See also Assholes: A Theory.

        Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

      generate a synthetic key, within the same domain of values, for each key that you wish to store.

      Care to elaborate?

      Perhaps you can post an example of how to generate a synthetic key for pairs selected from the domains: 'aaaaaaaa' .. 'zzzzzzzz'; and 0 .. 2^64-1?

      Each bucket in this hashref points to an arrayref of references.

      If the keys are synthesized, why do the values need to be arrays? And why "arrays of references"?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
      Yes, that is my name
      Is it? Robin and Robert are distinct names, aren't they?
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-03-28 21:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found