all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Wiegley <johnw@newartisans.com>
To: rms@gnu.org
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: async 1.0
Date: Thu, 21 Jun 2012 16:23:26 -0500	[thread overview]
Message-ID: <m2y5ng8ilt.fsf@newartisans.com> (raw)
In-Reply-To: <E1ShiKM-0000Aa-5G@fencepost.gnu.org> (Richard Stallman's message of "Thu, 21 Jun 2012 10:25:42 -0400")

>>>>> Richard Stallman <rms@gnu.org> writes:

>     async.el uses `start-process' to spawn a child Emacs process for the
>     purpose of invoking the lambda that is passed as the first argument to
>     `async-start'.

> I see it would work, but wouldn't it be horribly slow to start up?

You know, Emacs is suprisingly fast to execute if you use "emacs -batch -Q".
For example:

    vulcan ~ $ average -n 100 emacs -Q -batch --eval "(+ 10 20)"
    0.0393513631821

It's only 39.4ms overhead per invocation to use Emacs this way -- plus the
time required load modules used by the async process, and injection of the
variable environment.  For example:

    vulcan ~ $ average -n 100 emacs -Q -batch \
                    --eval "(progn (require 'smtpmail) (+ 10 20))"
    0.143285052776

Now we're up to 143ms.  What makes this OK is that the job I'm asking
`async-start' to do takes many seconds, such that the overhead of starting a
new Emacs interpreter is completely lost in the time required to do the work
-- time otherwise spent with me staring at a wait cursor.

As a further example: In Gnus, hitting M-g on the emacs-devel group takes
around 60s (I have a lot of back articles).  If async.el were integrated, this
operation would return instantly, with some kind of fontification to show the
group being updated in the background, and blocking behavior if I hit RET to
actually visit the group before it's done.

That's kind of how dired-async.el operates now: When you copy a bunch of large
files, control returns to you immediately, and each file is colorized with a
yellow background that gets removed once that copy operation is completed.

John



       reply	other threads:[~2012-06-21 21:23 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2hau86tfk.fsf@vulcan.local.i-did-not-set--mail-host-address--so-tickle-me>
     [not found] ` <E1ShM8F-0006IY-L9@fencepost.gnu.org>
     [not found]   ` <m2txy51z1k.fsf@newartisans.com>
     [not found]     ` <E1ShiKM-0000Aa-5G@fencepost.gnu.org>
2012-06-21 21:23       ` John Wiegley [this message]
2012-06-22  7:00         ` async 1.0 Teemu Likonen
2012-06-22 10:54           ` John Wiegley
2012-06-22 12:39             ` Michael Albinus
2012-06-22 22:02               ` John Wiegley
2012-07-04 17:10                 ` Samuel Bronson
2012-07-05  4:09                   ` John Wiegley
2012-07-05 19:58                     ` Samuel Bronson
     [not found]             ` <82d34r8ej9.fsf@gmail.com>
2012-06-22 21:50               ` John Wiegley
2012-06-23  1:44                 ` Stefan Monnier
2012-06-23  3:00                 ` Stefan Monnier
2012-06-23 16:26                   ` Lennart Borgman
2012-06-23 21:08                   ` John Wiegley
2012-06-23 21:28                     ` Jeremiah Dodds
2012-06-23 21:50                     ` Thierry Volpiatto
2012-06-24 15:02                     ` Christopher Schmidt
2012-06-24 15:42                       ` Bastien
2012-06-24 21:01                       ` John Wiegley
2012-06-25 14:53                         ` Christopher Schmidt
2012-06-25 23:54                           ` John Wiegley
2012-06-24 21:12                       ` ELPA and core services John Wiegley
2012-06-24 21:40                         ` Lennart Borgman
2012-06-25  2:20                         ` Stefan Monnier
2012-06-25  4:39                         ` Stephen J. Turnbull
2012-06-25  6:01                         ` Achim Gratz
2012-07-03 14:38                           ` Tom Tromey
2013-01-22 19:13                             ` Achim Gratz
2012-06-25  4:32                       ` stdlib for Emacs? [was: async 1.0] Stephen J. Turnbull
2012-06-23  6:25                 ` async 1.0 Stephen J. Turnbull
2012-06-23 21:05                   ` John Wiegley
2012-07-01  8:16                   ` Michael Sperber
2012-06-22 11:38         ` Richard Stallman
2012-06-22 21:39           ` John Wiegley
2012-06-22 23:02             ` Richard Stallman
2012-06-23  7:46               ` zwz
2012-06-23 20:49                 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2y5ng8ilt.fsf@newartisans.com \
    --to=johnw@newartisans.com \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.