all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 1st character change in file takes forever
@ 2002-12-17 13:46 David Klein
  2002-12-17 15:30 ` Barry Margolin
  0 siblings, 1 reply; 5+ messages in thread
From: David Klein @ 2002-12-17 13:46 UTC (permalink / raw)


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!

Before attempting the insert I can do whatever I want, e.g. split the
window, change to the *scratch* buffer and insert text there. Response
is instantaneous. After getting passed the first character, everything
works fine, even if I try to insert a character into a new file.

The behaviour remains even when I start emacs with 

emacs -q --no-site-file

or even

emacs -q --no-site-file

I have tried this under GNU Emacs 20.3.1 (I also tried it switching
the "emacs" executable to GNU Emacs 20.3.1).

My OS is

Linux sleepy 2.2.5-15 #1 Mon Apr 19 23:00:46 EDT 1999 i686 unknown

Any ideas how I can try to track this down? I tried 
(debug-on-entry 'self-insert-command)

but emacs tells me that it is a primitive (surprise, surprise).

-- 
Use of tools distinguishes Man from Beast. And UNIX users from WINDOZE lusers.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 1st character change in file takes forever
  2002-12-17 13:46 1st character change in file takes forever David Klein
@ 2002-12-17 15:30 ` Barry Margolin
  2002-12-22 11:33   ` David Klein
  0 siblings, 1 reply; 5+ messages in thread
From: Barry Margolin @ 2002-12-17 15:30 UTC (permalink / raw)


In article <m08yyodagg.fsf@bloombergREMOVETHISPART.com>,
David Klein  <dklein@bloombergREMOVETHISPART.com> 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.

-- 
Barry Margolin, barmar@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 1st character change in file takes forever
  2002-12-17 15:30 ` Barry Margolin
@ 2002-12-22 11:33   ` David Klein
  2002-12-22 19:15     ` Michael Powe
  0 siblings, 1 reply; 5+ messages in thread
From: David Klein @ 2002-12-22 11:33 UTC (permalink / raw)


Barry Margolin <barmar@genuity.net> writes:

> In article <m08yyodagg.fsf@bloombergREMOVETHISPART.com>,
> David Klein  <dklein@bloombergREMOVETHISPART.com> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 1st character change in file takes forever
  2002-12-22 11:33   ` David Klein
@ 2002-12-22 19:15     ` Michael Powe
  2002-12-24  8:19       ` David Klein
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Powe @ 2002-12-22 19:15 UTC (permalink / raw)


>>>>> "David" == David Klein <dklein@bloombergREMOVETHISPART.com> writes:

    David> Barry Margolin <barmar@genuity.net> writes:
    >> In article <m08yyodagg.fsf@bloombergREMOVETHISPART.com>, David
    >> Klein <dklein@bloombergREMOVETHISPART.com> 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.

    David> Assuming by "a system call trace" you meant the strace
    David> function, I did the following:

    >> emacs junk1& strace -c -f -ff -o emacs_trace -q -r -t -T -p1238
    David> (1238 was the pid of emacs. After running the strace
    David> command, I pressed the spacebar once in emacs. When it
    David> finally inserted the space into the buffer, I ^C'ed the
    David> strace).
    >> cat emacs_trace
  
[ ... ]

    David> I have no idea how to continue, besides the fact that
    David> 255963 read syscalls seems slightly on the high side for
    David> inserting a single character. Any ideas how to continue?

are you on a network?  if so, does this behavior continue if you
disconnect the machine from the network?

mp

-- 
Michael Powe					Waterbury, CT
-------------------------------------------------------------
"The most likely way for the world to be destroyed, most experts
agree, is by accident.  That's where we come in.  We're computer
professionals.  We cause accidents."  -- Nathaniel Borenstein

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 1st character change in file takes forever
  2002-12-22 19:15     ` Michael Powe
@ 2002-12-24  8:19       ` David Klein
  0 siblings, 0 replies; 5+ messages in thread
From: David Klein @ 2002-12-24  8:19 UTC (permalink / raw)


Michael Powe <michael+gnus@trollope.org> writes:

> >>>>> "David" == David Klein <dklein@bloombergREMOVETHISPART.com> writes:
> 
>     David> Barry Margolin <barmar@genuity.net> writes:
>     >> In article <m08yyodagg.fsf@bloombergREMOVETHISPART.com>, David
>     >> Klein <dklein@bloombergREMOVETHISPART.com> 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.
> 
>     David> Assuming by "a system call trace" you meant the strace
>     David> function, I did the following:
> 
>     >> emacs junk1& strace -c -f -ff -o emacs_trace -q -r -t -T -p1238
>     David> (1238 was the pid of emacs. After running the strace
>     David> command, I pressed the spacebar once in emacs. When it
>     David> finally inserted the space into the buffer, I ^C'ed the
>     David> strace).
>     >> cat emacs_trace
>   
> [ ... ]
> 
>     David> I have no idea how to continue, besides the fact that
>     David> 255963 read syscalls seems slightly on the high side for
>     David> inserting a single character. Any ideas how to continue?
> 
> are you on a network?  if so, does this behavior continue if you
> disconnect the machine from the network?

I am indeed on a network. I disconnected the ethernet cable and
rebooted. The problem still exists. It is possible that I need to
change some configuration files, but I don't know which ones. I am
running a modified redhat-release-6.0-1 version of linux.

-- 
Use of tools distinguishes Man from Beast. And UNIX users from WINDOZE lusers.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-12-24  8:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-17 13:46 1st character change in file takes forever David Klein
2002-12-17 15:30 ` Barry Margolin
2002-12-22 11:33   ` David Klein
2002-12-22 19:15     ` Michael Powe
2002-12-24  8:19       ` David Klein

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.