all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Why does adding a useless copy-sequence and discarding the result make my ELisp 40 times faster?
Date: Sat, 25 Mar 2017 10:05:48 +0300	[thread overview]
Message-ID: <83vaqxbzub.fsf@gnu.org> (raw)
In-Reply-To: <77900613-3b45-52f4-5770-38fe6f27e69c@gmail.com> (message from Clément Pit-Claudel on Sat, 25 Mar 2017 00:24:20 -0400)

> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Sat, 25 Mar 2017 00:24:20 -0400
> 
> On 2017-03-25 00:06, Clément Pit-Claudel wrote:
> > * Why does running additional, supposedly useless code speed things up so much? (1)
> 
> Interestingly, it turns out that (copy-sequence) isn't needed: instead, it's enough to use (sleep-for 0.000001) (or even (sleep-for cl-least-positive-normalized-float)) to get the 40x speedup.

Because, if you don't sleep, the process is not yet running by the
time you get to process-send-string, and then Emacs waits for a much
longer time for it to become running?



  reply	other threads:[~2017-03-25  7:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-25  4:06 Why does adding a useless copy-sequence and discarding the result make my ELisp 40 times faster? Clément Pit-Claudel
2017-03-25  4:24 ` Clément Pit-Claudel
2017-03-25  7:05   ` Eli Zaretskii [this message]
2017-03-25 10:38     ` Andreas Politz
2017-03-25 13:49       ` Clément Pit-Claudel
2017-03-25 16:38         ` Andreas Politz
2017-03-25 17:02           ` Clément Pit-Claudel
2017-03-25 17:26             ` Eli Zaretskii
2017-03-25 17:40               ` Andreas Politz
2017-03-25 17:49                 ` Eli Zaretskii
2017-03-25 17:37             ` Andreas Politz
2017-03-25 13:45     ` Clément Pit-Claudel
2017-03-25 10:47   ` Andreas Politz
2017-03-25 13:54     ` Clément Pit-Claudel
2017-03-26 13:14 ` Stephen Leake
2017-03-26 13:35   ` Clément Pit-Claudel

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=83vaqxbzub.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=cpitclaudel@gmail.com \
    --cc=emacs-devel@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.