Apr 12, 2017, 7:12 AM
Re: [FishMonger] iterate over millions hash entries
Use a database?
We can't really answer that question without seeing your code and sample data.
The only suggestion I can make at this point is for you to profile your script to see where it's spending it's time and then focus on optimizing the slow parts, which may or may not be the section where you think the problem is located.
Devel::NYTProf - Powerful fast feature-rich Perl source code profiler https://metacpan.org/pod/Devel::NYTProf
my code is a simple key,value hash.
keys are strings and values are numbers.
then i sort keys by the value number.
%hash = (
'foo' => 10,
'bar' => 30,
it just take lots of time because i have millions of keys, you think using a DB will be more efficient ? i will give a try with sqlite...
i already profiled the code and it show that it spend all his time in the loop over the hash.
(This post was edited by skualito92 on Apr 12, 2017, 7:13 AM)