How can I access the data in many large CSV files quickly from Perl? -
I have several scripts that currently read a lot of data in some CSV files. For efficiency, I use those modules to read and then make a hash by using one of the columns as an index. However, I have lots of files and they are quite large. And every script needs to be read in the data again
The question is: How can I continuously store these Pearl hasheets so that everyone can read at least with the CPU?
The combination of scripts is not an option. I want to ...
I applied the second rule of optimization and used to find out that most CPUs (about 90%) were in:
Text :: CSV_XS :: Field Text :: CSV_X :: Pars Text :: CSV_XS :: Pars
So, I created a test script which was used by all CSV files ( text: CSV_XS ), they were dumped using the Level module, and then went back and Stor Read them back using the enabled module. I have done this so that I can see the CPU time:
$ c: /perl/bin/dprofpp.bat Total time spent = 180 9 39 seconds user + system time = 950.5560 seconds special time% time exclicic cumulS # call sec / call csc / c name 25.6 243.6 243.66 126 1.9338 1.9338 Styim :: Prestige 20.5 194.9 194.92 893448 0.0002 0.0002 Text :: CSV_XS: : Field 9.4 9 90.19 90.198 893448 0.0001 0.0001 Text :: CSV_X :: Pars 7.48 71.07 71.072 126
Therefore, using strong costs around 25.6% compared to text: CSV_X Come back does not have much savings ...
Has anyone got the suggestion that how can I read these figures more efficiently?
Thank you for your help.
Parset the data once and put it in one. Query used.
Comments
Post a Comment