Xref: utzoo comp.editors:1222 gnu.emacs:2077 comp.unix.wizards:19988 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!sli!news From: rdh@sli.com Newsgroups: comp.editors,gnu.emacs,comp.unix.wizards Subject: Re: GNU Emacs, memory usage, releasing Message-ID: Date: 3 Jan 90 20:52:25 GMT References: <1558@aber-cs.UUCP> <129799@sun.Eng.Sun.COM> Sender: news@sli.com (news) Reply-To: rdh@sli.com (or uunet!sli!rdh) Organization: Software Leverage, Inc. Arlington, Ma Lines: 20 In-reply-to: jpayne%flam@Sun.COM's message of 2 Jan 90 21:45:25 GMT In article <129799@sun.Eng.Sun.COM> jpayne%flam@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.