Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Fastest way to lookup a point in a set

by BrowserUk (Patriarch)
on Aug 05, 2017 at 06:16 UTC ( [id://1196787]=note: print w/replies, xml ) Need Help??


in reply to Fastest way to lookup a point in a set

For pure speed, nothing will beat Perl's hashes. You can do it faster in C, but the penalty of calling in and out from Perl will alway slow you down whatever you try.

The real problem is that you'll rapidly run out of space at which point you'll compromise from fastest, to get fastest with less space.

At that point you'll be looking at some form of sparse bitmap of which there are many algorithms but none that cannot be undone by uncooperative data, so you need to get to know the distribution of your data and tailor your algorithms accordingly. If your data is truly random, then you may be out of luck.

A supersearch for my name and judy arrays will turn up a compact, single file version of the Judy array code that compiled clean and worked very well for that application. Still slower than hashes, but far more compact. Just hope you don't find any bugs, because the Judy code is horribly complex.


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". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit
  • Comment on Re: Fastest way to lookup a point in a set

Replies are listed 'Best First'.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-20 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found