P is for Practical | |
PerlMonks |
Re: Text differenceby erroneousBollock (Curate) |
on Nov 21, 2007 at 13:58 UTC ( [id://652132]=note: print w/replies, xml ) | Need Help?? |
The problem is the size of the file is large(About 800Mb to 2Gb)Repeating what was discussed in the CB, tye maintains Algorithm::Diff so he'd be your best bet for issues related to the module. With such large files though, you may need to change your approach. Assuming that Algorithm::Diff is bogging down due to the large file size, the idea is that you should make sure that not so much of the data is loaded at one time.
Method 1Algorithm::Diff works from two arrays, right? If so perhaps the easiest thing to do is just to pass it (references to) two Tie::File objects.Update: well, it's not that simple. Algorithm::Diff builds a hash to keep track of indexes, which grows (O(?)) with the length of the arrays passed.
Method 2If that didn't work (or was too slow) I'd do something like this (pseudocode):
-David
In Section
Seekers of Perl Wisdom
|
|