emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: request for review: Doing direct file I/O in Emacs Lisp


From: Richard Stallman
Subject: Re: request for review: Doing direct file I/O in Emacs Lisp
Date: Mon, 17 May 2004 07:04:14 -0400

    Hmm.. that IS curious.  In the save-buffer case, I call
    insert-and-inherit in a temp buffer thousands of times, then one call
    to save-buffer.  In the write-region case, I am calling write-region
    thousands of times.  I think the difference is the constant filesystem
    access in the latter case.

Now that I see what the last alternative consists of, I am sure that
is true.

You could try calling write-region using a temporary buffer
after making sure that buffer-file-coding-system is set.
That might be somewhat faster than using save-buffer.

    > I can't understand what alternatives you have compared.
    > Could you please explain them more concretely?

    If I start a process with start-process (/usr/bin/cat) and redirect
    its output to a file, it is far slower than if I simply output the
    same data to a file (eshell/cat) -- even though the resulting "output"
    in both cases is the same.  Why is receiving output via a process
    sentinel so slow?

As far as I can see, neither of the two cases you described involves
receiving output from a subprocesses at all, so neither one involves
the sentinel.  I suspect that the former case is slow because sending
input to the subprocess takes time.

Someone else suggested process switching overhead.may be a big
factor in that.  It sounds plausible.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]