GNU Emacs, memory usage, releasing

rdh at sli.com rdh at sli.com
Thu Jan 4 07:52:25 AEST 1990


In article <129799 at sun.Eng.Sun.COM> jpayne%flam at Sun.COM (Jonathan Payne) writes:

	   o Regular expression search is MUCH cleaner.  I ripped the code
	     out of JOVE and converted it to buffer gap, and it's fast and
	     much smaller, and definitely much easier to understand, and is
	     more functional (it searches across newline bounderies).

Just as an aside, a fast search algorithm dependant on contiguous buffer
(a gap is a special [degenerate] case of a contiguous buffer) can match
reasonable search strings with an average of less than one machine in-
struction per character searched (for an average PDP-10/68K/x86 class of
machine, anyways). With a linked list buffer scheme, I suspect that the
best one could hope for is an order of magnitude worse. I personally do
*MANY* more searches than I do gap-moving operations...

					-RDH
P.S.	By "reasonable search strings", I mean at least 4 distinct char-
	acters, typically 6 or 8. For example, "read", "write", "(arg1,"
	are all "typical, reasonable" search strings that search very
	fast, whereas "a" or "zzzzz" would not search nearly as fast.



More information about the Comp.unix.wizards mailing list