all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Robert Pluim <rpluim@gmail.com>
Cc: martin rudalics <rudalics@gmx.at>,  Emacs Devel <emacs-devel@gnu.org>
Subject: Re: Question about üarent-frame changes
Date: Sat, 28 Sep 2024 11:10:23 +0200	[thread overview]
Message-ID: <m2h6a0rvnk.fsf@pro2.fritz.box> (raw)
In-Reply-To: <m2jzf06l6i.fsf@pro2.fritz.box> ("Gerd Möllmann"'s message of "Wed, 25 Sep 2024 13:13:09 +0200")

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>>
>>> Robert Pluim <rpluim@gmail.com> writes:
>>>
>>>>     martin> Reparenting is useful because you can set up one child frame 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 want to.  On
>>>>     martin> GUIs, this approach has the advantage that you can avoid the (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 tooltip every
>>>>     martin> time incurred two entire GC cycles here.
>>>>
>>>> Would setting up frame faces be that expensive on tty? Iʼd 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 matters
>> (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).



  parent reply	other threads:[~2024-09-28  9:10 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 10:58 Question about üarent-frame changes Gerd Möllmann
2024-09-18 14:15 ` martin rudalics
2024-09-18 14:24   ` Ship Mints
2024-09-18 18:51     ` martin rudalics
2024-09-19  5:01       ` Eli Zaretskii
2024-09-19  8:10         ` martin rudalics
2024-09-18 14:26   ` Robert Pluim
2024-09-18 14:30     ` Ship Mints
2024-09-18 15:26       ` Gerd Möllmann
2024-09-18 15:32         ` Ship Mints
2024-09-18 15:22     ` Gerd Möllmann
2024-09-25 10:17       ` Gerd Möllmann
2024-09-25 11:13         ` Gerd Möllmann
2024-09-25 14:04           ` martin rudalics
2024-09-25 14:38             ` Gerd Möllmann
2024-09-25 15:29           ` Eli Zaretskii
2024-09-25 18:10             ` Gerd Möllmann
2024-09-26  4:54               ` Gerd Möllmann
2024-09-26  5:01                 ` Gerd Möllmann
2024-09-26  6:40                   ` Eli Zaretskii
2024-09-26  6:39                 ` Eli Zaretskii
2024-09-28  9:10           ` Gerd Möllmann [this message]
2024-09-18 18:51     ` martin rudalics
2024-09-18 15:03   ` Gerd Möllmann
2024-09-18 16:14     ` Eli Zaretskii
2024-09-18 16:42       ` Gerd Möllmann
2024-09-18 16:15   ` Eli Zaretskii
2024-09-18 18:52     ` martin rudalics
2024-09-19  0:33       ` Po Lu
2024-09-19  8:08         ` martin rudalics
2024-09-19  4:29       ` Gerd Möllmann
2024-09-19  8:09         ` martin rudalics
2024-09-19  9:15           ` Gerd Möllmann
2024-09-19  9:40             ` martin rudalics
2024-09-19 10:10               ` Gerd Möllmann
2024-09-19 11:13                 ` martin rudalics
2024-09-19 12:49                   ` Gerd Möllmann
2024-09-19  4:58       ` Eli Zaretskii
2024-09-19  8:10         ` martin rudalics
2024-09-19  8:20           ` Eli Zaretskii
2024-09-19  8:41             ` Po Lu
2024-09-19 10:30               ` Eli Zaretskii
2024-09-19 11:13                 ` martin rudalics
2024-09-19 11:33                   ` Eli Zaretskii
2024-09-19  9:26           ` Gerd Möllmann
2024-09-19 13:46             ` Po Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2h6a0rvnk.fsf@pro2.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rpluim@gmail.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.