On Wed, Feb 06, 2008 at 08:52:12AM -0800, Don Stewart wrote: > droundy: > > On Wed, Feb 06, 2008 at 11:44:42AM -0500, David Roundy wrote: > > > > Maybe we can egg on the bytestring people and get them to submit > > > > patches taking this further down (for example, they could improve our > > > > between newlines and nth newline stuff). > > > > > > That'd be nice. > > > > I should note, though, that we can also make probably faster progress by > > simply reducing the dependency on the counting of lines. In particular, > > I'd like to change Hunk to store a new and old PackedString + line number > > counts, rather than storing new and old [PackedString]. We'd still need to > > find the nth newline, etc, but we'd use much less memory and probably be > > faster to boot. Even better when we introduce (maybe before darcs 2 is > > released?) a new hunk file format that doesn't have all those +'s and -'s. > > Then parsing is lightning fast and we won't need duplicate copies of the > > hunk data in memory. > > I wonder if Data.Sequence would help here. Indexing is much cheaper. (Yi > is using this to index the nth line of a buffer cheaply).
Actually the nth newline stuff doesn't act on lists, it acts on PackedString, it seems to be cheaper not to store the actual lines, given how darcs behaves. It's definitely far less memory-intensive to avoid storing all the line positions. -- David Roundy Department of Physics Oregon State University _______________________________________________ darcs-devel mailing list darcs-devel@darcs.net http://lists.osuosl.org/mailman/listinfo/darcs-devel