Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Fastest way to lookup a point in a set

by oiskuu (Hermit)
on Aug 07, 2017 at 17:32 UTC ( [id://1196916]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Fastest way to lookup a point in a set
in thread Fastest way to lookup a point in a set

You did not answer his question though. Can you batch the queries or do you need to run them one by one?

If batching is allowed, then LanX has more or less revealed the solution. The problem is then very similar to sorting, and the fastest way to sort is probably the usual radix sort. (Maybe with AVX512 the balance has tipped in favor of merge sort; but I haven't tested that.)

Once you have binned/sorted the queries, the lookup is essentially a linear pass over the (sorted) dataset. Don't loop over queries, map them.

  • Comment on Re^3: Fastest way to lookup a point in a set

Replies are listed 'Best First'.
Re^4: Fastest way to lookup a point in a set
by eyepopslikeamosquito (Archbishop) on Aug 07, 2017 at 21:42 UTC

    Thanks for the tip. There is some scope for batching, I believe, and I hadn't thought of sorting. I'll write a new root node in the next day or so with details on the full problem.

    Update: the new root node: High Performance Game of Life

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-24 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found