unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 43237f3: * rcirc.el (rcirc-print): Prefer sleep-for over sit-for
@ 2022-02-19 20:07 Eli Zaretskii
  0 siblings, 0 replies; only message in thread
From: Eli Zaretskii @ 2022-02-19 20:07 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: emacs-devel

>     ; * rcirc.el (rcirc-print): Prefer sleep-for over sit-for
> 
>     Compare
> 
>             (benchmark-run 100000 (sit-for 0))
>             ;; => (2.600030102 12 1.523461324000003)
> 
>     with
> 
>             (benchmark-run 100000 (sleep-for 0))
>             ;; (0.015882939 0 0.0)
> 
> diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
> index 9d1600e..9bbba6d 100644
> --- a/lisp/net/rcirc.el
> +++ b/lisp/net/rcirc.el
> @@ -2043,7 +2043,7 @@ rcirc-print
>                         rcirc-log-process-buffers))
>            (rcirc-log process sender response target text))
> 
> -        (sit-for 0)                    ; displayed text before hook
> +        (sleep-for 0)                  ; displayed text before hook

Really?  Why?

sleep-for with the argument of zero is a fancy way of doing nothing,
so it definitely is going to be "faster".  But then why call it at
all?

The sit-for call was there to trigger redisplay.  Now that's gone.

I think you should revert that, or at least do something other than
call sleep-for with a zero argument.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-19 20:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-19 20:07 master 43237f3: * rcirc.el (rcirc-print): Prefer sleep-for over sit-for Eli Zaretskii

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).