comparing two lists, ndiff performance
Zbigniew Braniecki
zbigniew.braniecki at gmail.com
Wed Jan 30 08:38:30 EST 2008
bearophileHUGS at lycos.com wrote:
> Zbigniew Braniecki:
>> Is there a way to speed it up? Any easier way? Faster method?
>
> This problem is a bit messy. Maybe it's better to sidestep the
> problem, and not use a list, and create an object that wraps the list,
> so it always keeps an updated record of what changes are done... but
> you have to notify it if you change the objects it contains.
That would be sweet... But I rarely will have it on the plate.
In most cases I will load the two l10nObjects from the files and then
I'll have to compare them in the way described above.
So it's something like compare-locales or compare-l10n-directories
script in the easiest form.
and it'll be launched in the pessimistic case on around 40 locales each
of them made of ~800 l10nObjects.
I'll probably leave two methods. The faster for automated scripts which
just have to catch changes and report that the file needs an update, and
a detailed one for presenting it to the user.
I was just thinking that there maybe exists a smart, fast, powerful
method that would eliminate use of ndiff to compare two lists.
Thanks for help!
Greetings
Zbigniew Braniecki
More information about the Python-list
mailing list