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: Question about =?utf-8?Q?=C3=BCarent-frame?= changes Date: Sat, 28 Sep 2024 11:10:23 +0200 Message-ID: References: <9bc2af0a-d3c1-4ba6-a350-af6e2b85695d@gmx.at> <87y13phwbk.fsf@gmail.com> 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="2365"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: martin rudalics , Emacs Devel To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 28 11:11:23 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 1suTU2-0000Vg-UJ for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Sep 2024 11:11:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suTTE-0002Jp-Ox; Sat, 28 Sep 2024 05:10:32 -0400 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 1suTTC-0002BN-H0 for emacs-devel@gnu.org; Sat, 28 Sep 2024 05:10:30 -0400 Original-Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1suTTA-00049r-Tq for emacs-devel@gnu.org; Sat, 28 Sep 2024 05:10:30 -0400 Original-Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-378c16a4d3eso2846279f8f.1 for ; Sat, 28 Sep 2024 02:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727514625; x=1728119425; darn=gnu.org; h=content-transfer-encoding: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=Tif6IB6OHB7wio0sGKUQ067ZZVz2nHoGFCJP0FR3fj0=; b=MlNBF7D6wnAWaVVqjnV4tSINVJW95UqHP+WIqfcnq0giZotX/v1pilO+xDHa8n35H/ Uq4DlHn8bZgmprPa3dSYeLdpvFYsBg1WZJhmzkReFu8WS/uBSxtfLSznzJeK/Pf07EDs FWoIdBVEKSs+3wW+DH8WPqnZuiwipaFZjIl/1e/jwJsHmpDk3PmQMgXvCu6nowRSZLAB UMUURd11kkc2ggRm5ieXtS7+ysy5GedbAmzPafx68dH2AgJ8UF/0/PvUO+3g+ZqBYLWb vxwwEMN+d8OFNlNQqEYyW3EhvSXJcPy3ZbSkh0icLFPl6AHgyN3DlFpOgvQNZdlWLhmE nEnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727514625; x=1728119425; h=content-transfer-encoding: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=Tif6IB6OHB7wio0sGKUQ067ZZVz2nHoGFCJP0FR3fj0=; b=BjAeigAzqNAf9q4MyEo3snkz6RL5XXzkLtCYZIYG6VOQN4G2Mv8lWsGwsNE9rOyBz8 CZNKeUKU/npz67n2IFKC7V8380auzdETwa79yIa84czKaOwTYWiISv58Yc3kEPO7DwsW fLUktHQlYEhB7Ov2JJpdDod+ApgsNzHopkRaKLStrqmoLKFjEU2K2hX5HhCaGK3lCGIq bb+bx9/ZD2uXr6CAHaGsLq3TepK9uMXibVadlaP7dlFs0DetpGR3lCY1fu3HqjQ8c26J U4WRnxDmlKm2hLQdjnqLxMGPx7Kbod9HPggRp4QjZqMw1uRjdNE4RH5gtfEzlKGdiEvM 4CHg== X-Forwarded-Encrypted: i=1; AJvYcCXspqMXVeK07J6nzwzTt3Zl08uL6YmYDoVdvzPxmTgdAwaaBufr4n22wBDsirZGZ0WyGDKz53wHAE4/Bw==@gnu.org X-Gm-Message-State: AOJu0YynXrI2uI4JreixDpXVkX4kU4KtT3yTBuDnb3Pao8932ubdhOTl 7MU5D6Pg8n/2rRrPLYiT7YyZT7qF9/RiG2vXQENpXzTvYIhhOg7LcPC5NQ== X-Google-Smtp-Source: AGHT+IHx4GY3SWeP0njzwKDewyJ7LkBGAPb0/sdawP/C7nmleUjaPW6rB+LE8yb5lPaWOvrmRWpfFw== X-Received: by 2002:adf:fc8e:0:b0:37c:cf65:6b10 with SMTP id ffacd0b85a97d-37cd5a8c947mr4392071f8f.18.1727514625142; Sat, 28 Sep 2024 02:10:25 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e36953.dip0.t-ipconnect.de. [217.227.105.83]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c27c5977sm226945666b.55.2024.09.28.02.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 02:10:24 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Wed, 25 Sep 2024 13:13:09 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=gerd.moellmann@gmail.com; helo=mail-wr1-x429.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, 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:324158 Archived-At: Gerd M=C3=B6llmann writes: > Gerd M=C3=B6llmann writes: > >> Gerd M=C3=B6llmann writes: >> >>> Robert Pluim writes: >>> >>>> martin> Reparenting is useful because you can set up one child fra= me for some >>>> martin> special purpose, make it invisible when you don't need it,= and move it >>>> martin> to another frame and make it visible there whenever you wa= nt to. On >>>> martin> GUIs, this approach has the advantage that you can avoid t= he (at least >>>> martin> here) costly process of setting up frame faces every time = anew. Emacs >>>> martin> tooltips do that by default and I recall that showing a to= oltip every >>>> martin> time incurred two entire GC cycles here. >>>> >>>> Would setting up frame faces be that expensive on tty? I=CA=BCd really= love >>>> to have tty child frames, even if they were not blazingly fast. >>> >>>> From what I've seen so far, it's pretty fast, but OTOH my machine is >>> pretty fast (M1 pro). Let's see how it does when I'm a bit further. At >>> least hiding frames on ttys should be there before I can really try it >>> with posframe. Maybe also moving/resizing also. >> >> I think I can say now that it will probably be faster than on GUI, at >> least on macOS. Running >> >> (defun my-make-child () >> (interactive) >> (make-frame `((parent-frame . ,(selected-frame)) >> (background-color . "gray10") >> (foreground-color . "white") >> (top . 15) >> (left . 40) >> (width . 80) >> (height . 25)))) >> >> (defun my-time-child () >> (interactive) >> (dotimes (i 500) >> (let ((f (my-make-child))) >> (sit-for 0) >> (delete-frame f)))) >> >> (benchmark-run 1 (my-time-child)) >> >> shows 24s with GUI, and 8s on tty. I'm using Alacritty, in case that mat= ters >> (for the KKP keyboard support, not for performance). > > Small correction - I had timed tty build with debug. It's actually 2s > instead of 8s. I think I have hiding/showing child frames now. Timing this: (defun my-time-hide () (interactive) (let ((f (my-make-child))) (dotimes (i 500) (make-frame-invisible f) (sit-for 0) (make-frame-visible f) (sit-for 0)))) gives 0.3s on ttys, and 8.5s with Cocoa. Not too shabby :-). Also note that it's ca, 3 times faster on Cocoa than deleting and recreating the child frame is. That's ca. 17ms. And it's I think what Corfu and Posframe do (not 100% sure about Posframe).