From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: jari.aalto@poboxes.com (Jari Aalto+mail.linux) Newsgroups: gmane.emacs.bugs Subject: Re: [patch] 21.3 executable.find - Use cache in `executable-find' Date: Thu, 25 Mar 2004 11:14:03 +0200 Organization: Private Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1080206586 8401 80.91.224.253 (25 Mar 2004 09:23:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Mar 2004 09:23:06 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 25 10:22:58 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B6R4j-0003l0-00 for ; Thu, 25 Mar 2004 10:22:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B6R24-0006rD-CC for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Mar 2004 04:20:12 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B6R1s-0006nm-CJ for bug-gnu-emacs@gnu.org; Thu, 25 Mar 2004 04:20:00 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B6R1L-0006aJ-84 for bug-gnu-emacs@gnu.org; Thu, 25 Mar 2004 04:19:58 -0500 Original-Received: from [193.229.0.41] (helo=fep01-app.kolumbus.fi) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B6QjZ-000216-H3; Thu, 25 Mar 2004 04:01:05 -0500 Original-Received: from poboxes.com ([81.197.3.110]) by fep01-app.kolumbus.fi with ESMTP id <20040325090059.ELLL4029.fep01-app.kolumbus.fi@poboxes.com>; Thu, 25 Mar 2004 11:00:59 +0200 Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "25 Mar 2004 08:49:25 +0200") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (windows-nt) (i386-msvc-nt5.0.2195) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:7374 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:7374 * 2004-03-25 Eli Zaretskii elta.co.il> mail.default.spool | > From: jari.aalto poboxes.com (Jari Aalto+mail.linux) | > Date: Thu, 25 Mar 2004 00:24:10 +0200 | > | > | Any measurements to show that this indeed yields significant savings | > | in Emacs? | > | > No, but just common sense. | | My common sense says ``profile before you optimize''. But the results in this time are obvious. Cached path value is always faster than doing directory searches. Disk I/O is always slower than memory based search. Depending on how busy disk is, things are even worse. | > I have 50 directories in path and depending | > just where the /bin might be it could take ages to find same programs | > all again. | | I'd like to know how long is ``ages''. With today's caching OSes, | you'd be surprised how fast that could be. | | I could be wrong, of course, but only measurements will prove or | disprove that. See results above. I used slightly different Emacs version, because Cygwin is the "non patched" and Native NT Emacs is "patched" and I don't have an easy way to make NTEmacs "unpatched". It suprised, that NTEmacs were even slower - I though it would have been the other way round. Every time program is called the "search time" is added. Now if the program is called in a loop, that will even more make it slower (those cases are rare I believe). But anyway, it does improve things. Jari Emacs 21.3 / Win32 native, caching active time: 90000 microseconds << First search, without cache time: 0 microseconds << now cached. time: 0 microseconds time: 0 microseconds time: 0 microseconds time: 0 microseconds time: 0 microseconds time: 0 microseconds time: 0 microseconds time: 0 microseconds Emacs 21.3 / Win32 Cygwin version, no caching time: 13000 microseconds time: 14000 microseconds time: 13000 microseconds time: 14000 microseconds time: 13000 microseconds time: 36000 microseconds time: 14000 microseconds time: 14000 microseconds time: 14000 microseconds time: 15000 microseconds Test case: (let ((exec-path exec-path) a b list) (dotimes (x 40) (push "/this/dummy" list)) (append list exec-path) (dotimes (x 10) (setq a (current-time)) (executable-find "ls") (setq b (current-time)) (sit-for 0.3) (insert (format "\ntime: %s microseconds" (- (caddr b) (caddr a)))))) -- http://tiny-tools.sourceforge.net/ Swatch @time http://www.mir.com.my/iTime/itime.htm http://www.ryanthiessen.com/swatch/resources.htm Use Licenses! http://www.linuxjournal.com/article.php?sid=6225 Which Licence? http://www.linuxjournal.com/article.php?sid=4825 OSI Licences http://www.opensource.org/licenses/