emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 43237f3: * rcirc.el (rcirc-print): Prefer sleep-for over sit-


From: Eli Zaretskii
Subject: Re: master 43237f3: * rcirc.el (rcirc-print): Prefer sleep-for over sit-for
Date: Sat, 19 Feb 2022 22:07:30 +0200

>     ; * 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]