From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Intelligent stacking of messages in the echo area Date: Wed, 25 Dec 2019 01:32:27 +0800 Message-ID: <87imm5eij8.fsf@localhost> References: <87sgldfi9j.fsf@mail.linkov.net> <878sn3g0o7.fsf@gmail.com> <87pngepti3.fsf@mail.linkov.net> <87mubidptp.fsf@localhost> <838sn1wwys.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="69534"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacsuser@freemail.hu, emacs-devel@gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 24 18:34:42 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ijo4v-000HvH-PM for ged-emacs-devel@m.gmane.org; Tue, 24 Dec 2019 18:34:41 +0100 Original-Received: from localhost ([::1]:41008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijo4u-0004jm-If for ged-emacs-devel@m.gmane.org; Tue, 24 Dec 2019 12:34:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49422) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijo4o-0004jg-VS for emacs-devel@gnu.org; Tue, 24 Dec 2019 12:34:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ijo4n-0001xn-Ok for emacs-devel@gnu.org; Tue, 24 Dec 2019 12:34:34 -0500 Original-Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:46720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ijo4l-0001xG-NT; Tue, 24 Dec 2019 12:34:31 -0500 Original-Received: by mail-wr1-x433.google.com with SMTP id z7so20267526wrl.13; Tue, 24 Dec 2019 09:34:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=+SfVgsb1rynNIxDHwXVVcB1TGlNy08IjOSL3Q/+bekg=; b=p4DljlE/im7yL/cGcVzKGy40rbtaniKHLnxGLkx65Aim+A6UCyrDMN3KRX28/KAzag m+q8eljaiZlGqqpPT66mHM0aVBTwPHmAmmnjKPIXVarV3SATCpwgCyLhbAMp1MDLKly3 HU+9VhY7DQqQ6soJiTO57kv2u86z5oi4ImhlheYidPNbioD5eDexS3oShIa/JU3/abaB bDE6eQhvfzlUJcIPPsbErzgG8J/3qvlGT24D2l7w1cgppVYbgfTMsqK8Iep+ZbLaqEhf y5WzXA3dpmQN7HLVi2Xz1st33tWucYTR0nc4XG2q9dB5g34IfFVWtDGHxd9W4i0wjETH SFuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=+SfVgsb1rynNIxDHwXVVcB1TGlNy08IjOSL3Q/+bekg=; b=qZndHqbDZwx529oDWvp+IqqsFn4pA8LzxSPHIW0EN6HB5xQegbnZ/epevS3sZP83sc 8M5TImGNzxGLwdGHFZ0+r/Mg0NbBCM/ueYiL0EmRg9VkDKazEVzQSbkVvY11B0iixYEO Xw4b4oLK1Yt/BJmbqZeHS9XtblLh7amvd6cEzvg75hPXSZp3tptTMsaI2HK16Mr6jRk2 T/l2OkebBzwnq5Lf5y7VPZBiY7Srkj+8iA5BCohARpGV+yOnrK7+3X2kfYHcj8Puxb+y 33+3xnpZmKPcjxNZH71LpfQ/Oi6II9LdAguOa55ix/Hgi7TgkZGMZR7MnXLnQySyxWfg FzEQ== X-Gm-Message-State: APjAAAXOtns4UdhSC0DZ8PoKYhnXt8oPX2kvEve809j7gIhnpO6B7jvG QVFfertyyMTWUJHAII/n/PaTkxrYLvQ= X-Google-Smtp-Source: APXvYqwIe4Nbkeezs+8U3BXI3lollZmcsWYTfZRcPXKsQf02q9Ku40UsuHf/YI6CXjh7NstT2Yjsfw== X-Received: by 2002:a05:6000:160d:: with SMTP id u13mr37385316wrb.22.1577208870227; Tue, 24 Dec 2019 09:34:30 -0800 (PST) Original-Received: from localhost ([5.226.137.4]) by smtp.gmail.com with ESMTPSA id 5sm26130803wrh.5.2019.12.24.09.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2019 09:34:29 -0800 (PST) In-Reply-To: <838sn1wwys.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:243616 Archived-At: > Are you sure this is not due to the code that you wrote (and didn't > show)? IOW, if you change the window configuration, and then display > something, shouldn't you expect a thorough redisplay? Let me show some benchmarks with emacs -Q: ;C-x C-e (setq nomulti nil) ; C-x C-e (setq multi nil) ; C-x C-e (let ((start (float-time))) (setq set-message-function 'set-multi-message) (dotimes (i 8) (message "foo %s" i) (split-window-below) (split-window-below) (message "foo2") (delete-other-windows)) (setq multi-message-list nil) (push (- (float-time) start) multi) (car multi)) ; C-x C-e several times. ;; I can clearly see flickering (redrawing) of ;; emacs frame every time the mini-buffer is resized (let ((start (float-time))) (setq set-message-function nil) (dotimes (i 8) (message "foo %s" i) (split-window-below) (split-window-below) (message "foo2") (delete-other-windows)) (setq multi-message-list nil) (push (- (float-time) start) nomulti) (car nomulti)) ; C-x C-e several times ;; No redrawing is happening (message "Without multi-message: %s sec\nWith multi-message: %s sec" (/ (seq-reduce #'+ nomulti 0) (seq-length nomulti)) (/ (seq-reduce #'+ multi 0) (seq-length nomulti))) Without multi-message: 0.009443044662475586 sec With multi-message: 0.03390545646349589 sec The difference is more that 3 times. With an actual heavy-duty emacs config the difference is a lot more noticeable. Best regards, Ihor Eli Zaretskii writes: >> From: Ihor Radchenko >> Date: Tue, 24 Dec 2019 17:40:18 +0800 >> Cc: ndame , "emacs-devel@gnu.org" >> >> When I run a command changing current buffer and emitting multiple >> messages, emacs frame is redrawn every time a new message comes out. >> Specifically, I was running org-capture, which changes windows >> configuration, switches to different buffer, and emits multiple messages >> while running. Normally, it runs very fast (the capture template I used >> does not require any user input), but with multi-message, I can see the >> frame being redrawn on every new message popping up. Since window >> configuration is different, full redraw is forced and the whole >> org-capture runs a lot slower. > > Are you sure this is not due to the code that you wrote (and didn't > show)? IOW, if you change the window configuration, and then display > something, shouldn't you expect a thorough redisplay? -- Ihor Radchenko, PhD, Center for Advancing Materials Performance from the Nanoscale (CAMP-nano) State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg