Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Catching Cheaters and Saving Memory

by Corion (Patriarch)
on Oct 12, 2006 at 13:47 UTC ( [id://577836]=note: print w/replies, xml ) Need Help??


in reply to Catching Cheaters and Saving Memory

If I've understood your exposition right,. I've done something similar, counting transactions between pairs of parties. My approach was using a Berkeley DB with the keys being both parties and the value being a pair of count and amount. That was slower than the all-RAM solution but had the nice advantage that it worked. I also think that this should be faster than multiple passes through your large dataset, but I don't know.

If you're doing this in Perl, I'd go for DB_File and store strings in it.

As the order of votes doesn't seem to matter in your data, you can linearly scale your processing time by splitting up your data across machines, at least if you can reduce the results you want to collect to something that's associative and commutative, like the count of items and the sum of items. Of course you will have to be careful when merging your collected data back together - you should code sanity checks that check that the count of records in each chunk is equal to the sum of reported counts, and that the sum over all chunks is equal to the total number of records.

  • Comment on Re: Catching Cheaters and Saving Memory

Replies are listed 'Best First'.
Re^2: Catching Cheaters and Saving Memory
by diotalevi (Canon) on Oct 12, 2006 at 14:40 UTC

    DB_File is nice but BerkeleyDB is even nicer. perrin has some nice nodes on increasing its cache to get better runtim performance as well.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2025-06-22 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.