BigString (reducing peak memory)
Marco Pantaleoni
marco.pantaleoni at gmail.com
Wed Nov 16 19:05:33 UTC 2011
On Wed, Nov 16, 2011 at 7:43 PM, Aaron Bentley <aaron at aaronbentley.com>wrote:
> On 11-11-16 12:03 PM, Marco Pantaleoni wrote:>
> > Why is the whole file needed in memory at once?
>
> In general, it's not. We just have some code paths that do it even
> though they don't need to.
>
> There are a few places where this is trickier, like comparing two
> versions of a file. Diffs can theoretically match any line of a file
> against any other line of another version, so they need fast access to
> every line of both versions. Even that can be addressed by say, using
> hashes of the lines instead of the actual lines, but that is an
> algorithm change.
>
line comparison should be needed only on text files, which usually are
quite small.
Maybe we could have two separate code paths for text files and binary ones.
Marco
--
Marco Pantaleoni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20111116/a25c5dc6/attachment.html>
More information about the bazaar
mailing list