|Perl: the Markov chain saw|
Re^4: Optimizing a double loopby BrowserUk (Pope)
|on Jun 04, 2010 at 14:52 UTC||Need Help??|
But perhaps I can store the sets more efficiently? Maybe storing them all in one file is better?
Given a file 4GB containing 1000 sets of 1 million integers stored in packed binary form, the following Inline::C code accumulated the sums and sums of squares in just under 40 seconds. With some more effort that could be parallelised, but it probably isn't necessary:
So depending how long your current method takes, it might be worth considering.
For your two "other types of query", on the surface at least, it sounds like they could be quite easily solved using SQL. And calculating means and std deviations is bread & butter SQL.
Given the more realistic volumes of data you are now describing, an RDBMS, or even SQLite seems like they might be a good fit for your tasks.
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.