From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Excessive redisplay from lots of process output Date: Sat, 25 Feb 2023 07:14:30 +0800 Message-ID: <5BF9DB30-1CC1-450D-BCAE-A979B06DDE6B@yahoo.com> References: <834jrk1dli.fsf@gnu.org> <83fsaun9gx.fsf@gnu.org> <83a612n7dn.fsf@gnu.org> <834jran5x4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2698"; mail-complaints-to="usenet@ciao.gmane.io" Cc: azeng@janestreet.com To: emacs-devel@gnu.org, Eli Zaretskii , Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 25 00:17:15 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVhJS-0000ag-U7 for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Feb 2023 00:17:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVhJ6-0000vm-Ph; Fri, 24 Feb 2023 18:16:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVhJ4-0000vW-Bw for emacs-devel@gnu.org; Fri, 24 Feb 2023 18:16:50 -0500 Original-Received: from sonic311-52.consmr.mail.ne1.yahoo.com ([66.163.188.233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVhJ2-00026l-Cl for emacs-devel@gnu.org; Fri, 24 Feb 2023 18:16:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1677280605; bh=WxQqmNhz+SeiiFghFlWKZYf3SqTTQIFHWFk3dXovMKk=; h=Date:From:To:CC:Subject:In-Reply-To:References:From:Subject:Reply-To; b=c3X1k11o3mhJRf/fDm4x8shGjmqur3yX2GVJmUTog3yuqxNujlNAQ6hN/4cMyHUrlc7Ycnsw/tFbrnMI5KRnAOkk/Zn7Ie5XLugnV5Ga9l5htm9ZSJ0DN5Rt9DnsjxVr4rFTxIVtvCdtpK02EsHvZVy4s5PtdF8AUii7y+6WnfAxVt9hYcyWC7xUoq2C0WDXIC1V09SmS7kjTN9//IgX6lTXx1jhnbVs0eHqv0ZU1hZwp8ItGj7r0E5GjkwDsb+Za8TU8aOhNoF0G3eQQaabcuIFs4gIrnjvVEm+nNrn456Ty2IsWpX2xdeHl5Av97eg9mA/k1lTD8gxjBRslwTofw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1677280605; bh=NZGcVOE2I/xXWa03fJx0lCJIYpdAeeA2iUILeKNXW30=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=gJ+zlS310ZlNr6F/9IkFGKwr+0OViCSBQVuKUHlDGujcwOSpee5mRz9SArkTQYrEQd8+WmG0zo9n9Cl9ipxip5Zp77neQguGV2rI0oRMCZddVxeoOOOw21S39ATJfzag2WHNeCJTWCkQi3pfqgNvDMnMXPvBVhy3mJce4CZGAoDBPY7nhtnGwFWnzECshEhBsCm953RdFuT+qIsX8RjFI7w0vxqQygaBkL4uVX8D+SmwV5SeK67CzWp2pqRx6/LM5O0Xtm4oN4VTUnQHwEYSHTFYDXpStXvoITIwGfJY8zZxqy0e0sJ5yo65RjyWumqilEDGij+6gBrW9tiz2OX04Q== X-YMail-OSG: _VVzqkYVM1ldAHbMwVLh.ne4fskJEvGgEH_YLsmV0mp.KSX.t.A4EhELFxxJvKh M5RIuRxhffxKr.5BQY9Z3HvAgJ4KFgJeiFza0S5JWQrAT6W0Cj3CXHPQ0f6A9UJEPPKySu9zUsZg Jg8Db55RqNncj5n_VxN_nte1wHD2tH9hLuKYF9CmVv1E_obLVlel4g5ISjNLWFfurRz3rkX.JJDF l2dy8fYbJ9t8JYoNO1LdykYrO8qHxX9KiLhlLfDpqQBuBs1B8e3rBvUbMiuOJ8FsQSeR1Q3zl.TT RY3tnH3mYvi7xx7c6F.ZnEUKr8OIGdUC_eBWQAHMFy_Vz__2t5tgTajeHzh5ciMM9WwFwZYP85uu _1Yt0PVTW3kwzDa6tHZ4Qe8uudIMmVeDCoiRO4Bkdg5dydFIwLeeE76kR2nN6f0C3pkuWfYU62kI zua43QQTNwQw6z70HZJ63Kj4cWHvzkiame25z33hv3SOJJvQoz0OGtVx.S.cjMQkc3tT6mDseGY1 oxkVYeoDCFV53gtsuFoYW2LawdVkfqGn1xg7nX3PLS0HEgVKXoeabi3zRcBpPYLA6bRf57ImUkBq wWLBQWX.Qr_z5eUtvo2Idk05KhrWK_633fH196e5A0H2LKGs9fwQA_3dlQ5RZYJLBUuZcBko68_1 S_yX4sEYKDpJag9CCulXGa2fRtuOXxl5brc9s2Jga.VG0yCaiAJgEKoCLdgfjoQUMXbeCr_TWAC4 K0VTXXmU9Y7.Xvs2pZLNtsz7.G4ZpXhX2hDTdYap7ghDZLyV9Xrw2EilPNWTy4O3WwtteKvhLP39 OPvj_DE4teW7ypGRcvIT4_0GxVgmVLUOEf8Xx7_2Gc X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Fri, 24 Feb 2023 23:16:45 +0000 Original-Received: by hermes--production-sg3-9fc5746c8-vmkgs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 483806719121acbc62d81c3b39d2be66; Fri, 24 Feb 2023 23:14:42 +0000 (UTC) In-Reply-To: <834jran5x4.fsf@gnu.org> X-Mailer: WebService/1.1.21221 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.188.233; envelope-from=luangruo@yahoo.com; helo=sonic311-52.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303780 Archived-At: XFlush is not so expensive, as it simply makes requests that are already in= the output buffer happen=2E An implicit flush happens before XNextEvent, = XEventsQueued, and XPending=2E What is expensive is _XReply, so I would guess that is the source or Spenc= er's problems=2E I removed most unnecessary calls from Emacs 29=2E If tha= t is still slow, then please tell me where the call is=2E Emacs should not= call _XReply just to redisplay! On February 25, 2023 4:51:19 AM GMT+08:00, Eli Zaretskii = wrote: >> From: Spencer Baugh >> Date: Fri, 24 Feb 2023 15:33:52 -0500 >> Cc: emacs-devel@gnu=2Eorg, >> azeng@janestreet=2Ecom >>=20 >> On Fri, Feb 24, 2023 at 3:19 PM Eli Zaretskii wrote: >> > >> > > From: Spencer Baugh >> > > Date: Fri, 24 Feb 2023 15:08:17 -0500 >> > > Cc: emacs-devel@gnu=2Eorg, >> > > azeng@janestreet=2Ecom >> > > >> > > > This is normal=2E >> > > >> > > Just to make sure I understand, you said earlier: >> > > >> > > >There are many variables and flags Emacs uses to decide when somet= hing >> > > >changed that needs the display to be updated=2E Those should gene= rally >> > > >prevent Emacs from running the expensive parts of redisplay if the= y >> > > >are unnecessary=2E The question is why this doesn't work in your = case=2E >> > > >> > > Are you saying this does not apply in the case of reading from >> > > process output? That after reading process output, we always do >> > > an expensive redisplay? >> > >> > Whether redisplay is expensive or not depends on many factors=2E But= we >> > always flush the frame in that case, yes=2E >>=20 >> Why? It seems unnecessary if nothing has changed=2E > >I'm not sure we know that nothing has changed=2E I'm also not sure I >understand why XFlush is so expensive when nothing or almost nothing >has changed on display=2E Maybe Po Lu could comment=2E > >> > AFAIU, what is problematic for you is the X traffic causes by XFlush= =2E >>=20 >> I think that is problematic for anyone running with a slow X server; it >> gives the X server a lot to process=2E > >Are you sure? What exactly does XFlush send to the X server if >nothing was changed on display? > >> In other words, I think XFlush should be considered "expensive" and >> avoided where possible=2E > >If that is possible, I agree=2E >