![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Complex Sorting Optimization?by orbital (Scribe) |
on Nov 21, 2001 at 00:04 UTC ( #126609=perlquestion: print w/replies, xml ) | Need Help?? |
orbital has asked for the wisdom of the Perl Monks concerning the following question:
I am working with some log files that are being generated by a multi-threaded application. So my log file is not in any kind of sorted order. I was able to figure out how I wanted to parse my data and sort it, I have no problems there. My problem lies in the performance of the sort that I created, lets take a look at the code:
This code does exactly what I want it to accomplish, it ignores lines that don't match and sorts by my CD\filename then by page number and then by the keys being indexed. The problems I am running into is with the speed of this sort (seems very slow 16sec on a 2.3MB file on a PIII 766Mhz) can I speed this code at all? My other issues is with file size, the larger the logfile the more memory perl hogs. What kind of techniques can I use for sorting a huge file without taking a bunch of RAM in the process.
Back to
Seekers of Perl Wisdom
|
|