BigString (reducing peak memory)
Aaron Bentley
aaron at aaronbentley.com
Thu Nov 17 14:19:58 UTC 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11-11-16 02:05 PM, Marco Pantaleoni wrote:
> On Wed, Nov 16, 2011 at 7:43 PM, Aaron Bentley
> <aaron at aaronbentley.com <mailto:aaron at aaronbentley.com>> wrote:
> 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.
Maybe, but it can be hard to reliably detect binary files. Bazaar
uses a heuristic of checking for NULL bytes, but I've seen it fooled
by PDF files, for example. And there are several text-based formats
like SVG that can still get pretty big depending on the use case.
I prefer solutions that work in every case, and work well most of the
time.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk7FGA4ACgkQ0F+nu1YWqI00CwCcCtysd+iWmEQX2dZixFXAeaoK
/o0AnRNP5vQTwiwdlW62owtxxztHooYY
=hu3I
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list