From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Removing redisplay-dont-pause Date: Tue, 03 Dec 2024 05:55:27 +0100 Message-ID: References: <86ed3awd16.fsf@gnu.org> <86v7w582ms.fsf@gnu.org> <9E402D0E-43D9-458F-8C51-043F9F398DD9@gmail.com> <86bjxv67ha.fsf@gnu.org> <874j3nr8d6.fsf@localhost> <865xo35uwe.fsf@gnu.org> <871pyrqwyz.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33595"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Ihor Radchenko , Eli Zaretskii , mattias.engdegard@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 03 05:56:21 2024 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 1tIKxP-0008Uf-JF for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Dec 2024 05:56:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIKwi-00048N-4N; Mon, 02 Dec 2024 23:55:36 -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 1tIKwg-000489-9C for emacs-devel@gnu.org; Mon, 02 Dec 2024 23:55:34 -0500 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIKwe-00055s-Jr; Mon, 02 Dec 2024 23:55:34 -0500 Original-Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-434a1fe2b43so45527465e9.2; Mon, 02 Dec 2024 20:55:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733201730; x=1733806530; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=yrfDo0f/g8ryV5Rp66tPHMS05A9l+E9I/lkgLbWxkFo=; b=Hw54gwCrdVBYMZfFGgOnz+ZyPcggkHPzbr0l62ub0zpjfdmwhltJdpJ69PN1BmUplZ w+W05rxrzJC9RIC34V6IRx/mBMoATQNQxmVowvpz16dgSY9Vvk3zWslxoxuiQRGR8458 ktowAlQcJFcAt/Zr4YFPaU4+hNay3RSqkwUVi6iPP/3BG5xs2UKJKzsh0ziCSolGEGXA 3yv09qj/r3JrNaunZzwxxccmoSq/QDBx/koXNiiI77kpRK4qGw+AwLPL84tGBTvp1tgO sxLs1lAvQiXG/fdwgR7x1AHJaReiMF2hhgIJWfkTVPOtvGlWgWCD+R197ODh5B/7CNJW jbJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733201730; x=1733806530; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yrfDo0f/g8ryV5Rp66tPHMS05A9l+E9I/lkgLbWxkFo=; b=RVPXiAf4/7ByYefsX63O5Au5nzq3kLAlzvO1M3LYzd+ssi+n1GIGDd+5FN3E1FXWjx XUj/z1NmvEXdt8440RqsW6tpHH8wz0XcKw3kGcDGkgz+IVaZ1/VZ6pjef1xUB61EVZE1 VOfkghCZoQrlEZN3DrN4X31L/ZJtjiKAvBKrmFfoa6m2WQTF99o0VZ8p7TAaPexEfWhb JMTDy0MD9O+2vxBgKxNC5LN4fTgdA8cu6B7O3DQX7ZiSH26olqT8yVl1smrta3tciqby mUSQUwA+WAd0BJ2aye/Qls/sORmBMVBiTle6oxfGkQyG2Gki/95VOmOXuN8NQlpNvNmJ J0dg== X-Forwarded-Encrypted: i=1; AJvYcCU9JeKyNizatgAL7ivW2UpayNVqkd/tHb2Uqw/qg84rglPKxwToMbtYCzlVobayF6dxnCaQ@gnu.org, AJvYcCVg7Pwr9b9dhkzxar15pwJhbamo83s0I5y715kFtt0tbn18vBDkE9IRE2IUeLVsVOCTU4AOrDdjzt9sVI4=@gnu.org X-Gm-Message-State: AOJu0YwPHojnevs6XjGt5kZePMNZ++PpD02mX0JM5K4UgQHhrCVsGMom XEChRZ3dCgYh7PMIb4gxoRbcDG800xHL4lid4rVU5PMUwXtLqOMWtSZytw== X-Gm-Gg: ASbGncut1l3zG3XM9loSPOqrJn85fg+FjwUJ+U5SPdiyStm5GvrSikYPQqjfaxBOToM vePIlXYI+Ay1foouH81XKFjiRINqSj993hdx5UKrWho4CMomAwyMTCCtlI+6W7TwaypF4qLdgiw nPKK4yB8DVWfgXiSmcoij5NbXWq/c0OWdpV2dd0Np1MQ/DxR7lqxNdP9rfvTo+xeWHQbvGMnB8K YlSpZANSH/beqjIPEh60p8piJs0KimbgSCRb9z2Wnl487TX+H9w7VB0oddnbQAY0rCcPsl53GWi rLbvf7Y6RmDv5lAnUL+m1mVl34UNK+EVhSDkpeiT/sm5kezYpbHaH4/wBwg= X-Google-Smtp-Source: AGHT+IHXlhyIju2mdj2XMi53M4u1GA58Au2nxBa6rkZKKCm7mrfLQknLuXTonfzC/R+fhCD4FAc9oA== X-Received: by 2002:a05:600c:4695:b0:42c:ba83:3f0e with SMTP id 5b1f17b1804b1-434d09a6908mr7912565e9.7.1733201729885; Mon, 02 Dec 2024 20:55:29 -0800 (PST) Original-Received: from pro2 (p200300e0b74ffd00f86e70adfa453283.dip0.t-ipconnect.de. [2003:e0:b74f:fd00:f86e:70ad:fa45:3283]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd3a710sm14200884f8f.57.2024.12.02.20.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 20:55:29 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Mon, 02 Dec 2024 18:50:20 -0500") Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x329.google.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=ham 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:325966 Archived-At: Stefan Monnier writes: >>> Assume the incoming events come every T seconds and take T1 seconds to >>> run, and the subsequent redisplay takes time T2+T3 (where T2 is the time >>> in the middle where `redisplay-dont-pause` is consulted). >> >> I think you meant to say that T3 is the phase at the end where >> redisplay-dont-pause is checked, the update phase that writes to the >> screen. T2 would then be the phase where the glyphs are produced. > > My "analysis" doesn't care what's done when betwen T2 and T3, but yes, > T2 is the part that's affected by long lines, jit-lock, invisible text, > whereas T3 is about actual "drawing", so it can be affected by your 1200 > bauds serial line (if you're sufficiently unlucky to be stuck behind > such a thing). Yes, I think we have the same model. I've always divided redisplay into two phases, in my head: (1) glyph generation and (2) update, where update starts basically when update_frame is called. > My impression is that, historically, T3 has been on a mostly decreasing > slope over time, whereas T2 has been on a rather increasing slope. > So back in Emacs-18, I suspect that T2 was usually dwarfed by T3, > whereas nowadays it's rather the reverse. Yes, 100%. T3 started to matter less and less during the 90s, and I'd say it isn't a problem at all nowadays. (I don't even know where slow serial connections have to be used today, or why. And USB 2 has already something like 420 Mbits/s, IIRC.) >>> - If T < T1, then we plain and simply can't keep up at all, the >>> redisplay is just not run at all and incoming events keep accumulating >>> as we fall ever further behind the incoming events until the incoming >>> events stop (at which point Emacs will only refresh its redisplay >>> after it has finally caught up with the buffered input). >> The direct_output_for_insert optimization was though for that, ensuring >> that at least the line one types in is made visible on the screen. > > That's my understanding as well. > But the change in hardware performance has made it so that in the > `direct_output_for_insert` case nowadays T is almost never > T1+T2+T3, > which is why we could remove that optimization. Yes I think that change was the Right Thing, because it reduces complexity. (BTW, there is a third part of the slow terminal story that I haven't seen mentioned yet, and which I think might be a candidate for removal: "scrolling". If that were no longer done, all the hocus pocus around frame-based redisplay could go. Just saying; it would be larger change.)