FreeBSD Ports statistics
Lele Gaifax
lele at nautilus.homeip.net
Sun Sep 3 20:17:23 BST 2006
John Arbash Meinel wrote:
> Lele Gaifax wrote:
>> reader = codecs.getreader(encoding)
>> log = reader(output of rlor)
>> return iterator_over_changeset_from_rlog(log)
>>
>> so maybe the reader is retaining its input and should be explicitly
>> closed, or something like that...
>
> Well when using an iterator like that, it could easily be holding open a
> file object. I don't really know myself. I assume you are doing this
> because you think it is better for not having to read in the entire file?
The output is a StringIO object, fetched from the "cvs rlog" subprocess
stdout&stderr, and the parser consumes it a line at a time...
> Is 'output' a string object, or a file? Because multiple calls to
> string.encode() is usually very inefficient. It is usually better to do:
>
> txt = file.read().decode(encoding)
> rather than:
> for line in file:
> txt = line.decode(encoding)
>
> I saw some large advantages in bzr in doing the first form (versus
> calling decode() about 100K times).
>
Yes, I read. I'll try to dig further.
> Yep, it worked, and I can see that it does update multiple files at once
> now. So now 'cvs update' isn't as big of a deal, just 'bzr commit' time,
> and some other time that I don't know what Tailor is doing. Right after
> it prints the log message, it spends a couple seconds just sitting there
> before it starts spawning 'cvs update'.
Uhm, I assume you don't have a "delay_before_apply" option... so this is
strange. Thanks for reporting, I'll try to explain that too.
ciao, lele.
More information about the bazaar
mailing list