Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!acevedo From: acevedo@athena.mit.edu (Gabriel) Newsgroups: comp.emacs Subject: Re: Speed of replace-match vs. replace-string Message-ID: Date: 16 Feb 91 21:36:17 GMT References: <1991Feb13.200837.8025@athena.mit.edu> Sender: news@athena.mit.edu (News system) Distribution: usa Organization: Massachusetts Institute of Technology Lines: 22 In-Reply-To: hugh@ear.mit.edu's message of 13 Feb 91 15:10:35 The reason is that kill-ab-1 is not as simple as it seems. `replace-string' is NOT an elisp primitive function; it is defined in `loaddefs.el', and it actually calls a rather complex function `perform-replace', which is written in elisp. On the other hand, `replace-match' is an elisp primitive. And, as always, the rule of thumb is that elisp primitives run much faster than any substitute written in elisp. To find out if a function is a lisp primitive or not, use `subrp': subrp: T if OBJECT is a built-in function. -- Raul Acevedo acevedo@athena.mit.edu "Remember, Information is not knowledge; Knowledge is not Wisdom; Wisdom is not truth; Truth is not beauty; Beauty is not love; Love is not music; Music is the best." - Frank Zappa