From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Excessive redisplay from lots of process output Date: Fri, 24 Feb 2023 22:19:48 +0200 Message-ID: <83a612n7dn.fsf@gnu.org> References: <834jrk1dli.fsf@gnu.org> <83fsaun9gx.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22117"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, azeng@janestreet.com To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 24 21:20:37 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 1pVeYW-0005Ri-Ey for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Feb 2023 21:20:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVeXn-0007Fr-Bc; Fri, 24 Feb 2023 15:19:51 -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 1pVeXl-0007Fi-Ic for emacs-devel@gnu.org; Fri, 24 Feb 2023 15:19:49 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVeXk-0005tH-PB; Fri, 24 Feb 2023 15:19:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=0S58SywtK3GEZlswAQ9XRUV5l77a3a9KfSbPzukXa5c=; b=rMF6O05caeAe +lMQDXmRqaZ715t7abaxN1hVL/GZ5farvIp7jqJNGMt2GlADjfzBaOrHHQT2HkX3bg55804fc5jtJ GcupWiUbJUWu8IpXJ7fF3M3kydIB9Yp7YBejVJTQTUKND1C5wPBFBel3tyiNFsOdrzdHX5beWwrC6 Vw+al8wtNb2Wyi/2vpLe61tlDTju6lCr6FFbm0tinPQ97sHJrmOys8Halu2/4l+TB4CQqT3M2rUhQ BMfnkQw+pTI+/8FUnMji2BiM91B4y7gg18OSt61u2NM5eUTNMkX/A/0zVvyqlkNYHzgtiWv9Xhoos O6ict5faZ7gfeWkUSSnaow==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVeXk-0004pw-6k; Fri, 24 Feb 2023 15:19:48 -0500 In-Reply-To: (message from Spencer Baugh on Fri, 24 Feb 2023 15:08:17 -0500) 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:303762 Archived-At: > From: Spencer Baugh > Date: Fri, 24 Feb 2023 15:08:17 -0500 > Cc: emacs-devel@gnu.org, > azeng@janestreet.com > > > This is normal. > > Just to make sure I understand, you said earlier: > > >There are many variables and flags Emacs uses to decide when something > >changed that needs the display to be updated. Those should generally > >prevent Emacs from running the expensive parts of redisplay if they > >are unnecessary. The question is why this doesn't work in your case. > > 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. But we always flush the frame in that case, yes. > If so, it seems to me that this could be substantially improved. > Why do we always do an expensive redisplay after reading process > output, even if nothing has been changed to make it necessary? We don't always do an expensive redisplay, but we always call XFlush. > I would like to improve this so that my Emacs does not do > expensive redisplay whenever it reads process output, which is > substantially hurting performance for me when there's lots of > process output to read. AFAIU, what is problematic for you is the X traffic causes by XFlush.