From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: Andreas Politz <politza@hochschule-trier.de>
Cc: Emacs developers <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 09:54:15 -0400 [thread overview]
Message-ID: <de138e86-9772-f5a3-7843-1fe715da58f3@gmail.com> (raw)
In-Reply-To: <871stlhbve.fsf@luca>
On 2017-03-25 06:47, Andreas Politz wrote:
> Clément Pit-Claudel <cpitclaudel@gmail.com> writes:
>
>> 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.
>
> What about this explanation: If you make Emacs wait inside the loop, it
> can send some of the strings immediately. Otherwise, it'll have to
> store them all/some in memory first.
Possibly! But does this theory explain the following ((3) in my original email)?
(benchmark-send-string t 200 65536 "read") → (0.18765710700000002 46 0.14072835099999995)
(benchmark-send-string nil 200 65536 "read") → (3.397287521 0 0.0)
(benchmark-send-string t 1600 8192 "read") → (0.258897164 49 0.17045154200000004)
(benchmark-send-string nil 1600 8192 "read") → (0.07095391 0 0.0)
Sending 1600 strings of length 8192 with or without sleeps is much faster than sending 200 strings of length 65536.
Thanks for your ideas!
Clément.
next prev parent reply other threads:[~2017-03-25 13:54 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
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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=de138e86-9772-f5a3-7843-1fe715da58f3@gmail.com \
--to=cpitclaudel@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=politza@hochschule-trier.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).