From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Klein Newsgroups: gmane.emacs.help Subject: Re: 1st character change in file takes forever Date: 22 Dec 2002 13:33:15 +0200 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1040557010 12651 80.91.224.249 (22 Dec 2002 11:36:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 22 Dec 2002 11:36:50 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Q4Ox-0003GO-00 for ; Sun, 22 Dec 2002 12:36:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Q4OC-0000vP-04 for gnu-help-gnu-emacs@m.gmane.org; Sun, 22 Dec 2002 06:35:24 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0902.news.uu.net!not-for-mail Original-Newsgroups: gnu.emacs.help X-Newsreader: Gnus v5.7/Emacs 20.7 Original-Lines: 52 Original-NNTP-Posting-Host: 199.172.169.19 Original-X-Trace: 1040556796 8280 199.172.169.19 Original-Xref: shelby.stanford.edu gnu.emacs.help:108416 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:4945 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4945 Barry Margolin writes: > In article , > David Klein wrote: > >When I first try to insert a character into a buffer that is > >associated with a file on disk, the insert takes close to a minute! > > During that first change, Emacs checks whether someone else has modified > the file, and also checks for a lock file. For some reason, these checks > are taking a long time. Try doing a system call trace to see what it's > doing during that time. > Assuming by "a system call trace" you meant the strace function, I did the following: > emacs junk1& > strace -c -f -ff -o emacs_trace -q -r -t -T -p1238 (1238 was the pid of emacs. After running the strace command, I pressed the spacebar once in emacs. When it finally inserted the space into the buffer, I ^C'ed the strace). > cat emacs_trace % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 98.46 12.598431 49 255963 read 1.21 0.154380 5718 27 select 0.13 0.016690 98 170 ioctl 0.06 0.007652 93 82 sigreturn 0.06 0.007152 170 42 SYS_174 0.03 0.004175 66 63 alarm 0.03 0.004048 92 44 fcntl 0.02 0.002571 234 11 write 0.00 0.000091 4 26 kill 0.00 0.000070 70 1 symlink 0.00 0.000068 3 27 getpid 0.00 0.000038 3 13 gettimeofday 0.00 0.000033 11 3 3 access 0.00 0.000024 12 2 1 open 0.00 0.000020 20 1 stat 0.00 0.000011 4 3 SYS_175 0.00 0.000008 8 1 close 0.00 0.000004 4 1 lseek ------ ----------- ----------- --------- --------- ---------------- 100.00 12.795466 256480 4 total I have no idea how to continue, besides the fact that 255963 read syscalls seems slightly on the high side for inserting a single character. Any ideas how to continue? -- Use of tools distinguishes Man from Beast. And UNIX users from WINDOZE lusers.