From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel 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 Message-ID: <83vaqxbzub.fsf@gnu.org> References: <77900613-3b45-52f4-5770-38fe6f27e69c@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1490425564 17885 195.159.176.226 (25 Mar 2017 07:06:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Mar 2017 07:06:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 25 08:06:00 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crflv-00042G-AS for ged-emacs-devel@m.gmane.org; Sat, 25 Mar 2017 08:05:59 +0100 Original-Received: from localhost ([::1]:36206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crfm1-0002HZ-7K for ged-emacs-devel@m.gmane.org; Sat, 25 Mar 2017 03:06:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crflv-0002HU-Vk for emacs-devel@gnu.org; Sat, 25 Mar 2017 03:06:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crfls-0003mi-SQ for emacs-devel@gnu.org; Sat, 25 Mar 2017 03:05:59 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crfls-0003mc-NH; Sat, 25 Mar 2017 03:05:56 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4491 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1crflr-0005EN-4i; Sat, 25 Mar 2017 03:05:55 -0400 In-reply-to: <77900613-3b45-52f4-5770-38fe6f27e69c@gmail.com> (message from =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel on Sat, 25 Mar 2017 00:24:20 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:213328 Archived-At: > From: Clément Pit-Claudel > 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?