Re: [dev] Culling all the way down

From: Mattias Andrée <maandree_AT_kth.se>
Date: Sun, 6 Sep 2020 09:55:02 +0200

On Sun, 6 Sep 2020 09:48:06 +0200
Mattias Andrée <maandree_AT_kth.se> wrote:

> On Sun, 6 Sep 2020 08:21:45 +0200
> Tobias Bengfort <tobias.bengfort_AT_posteo.de> wrote:
>
> > Hi,
> >
> > I am currently creating a curses application that is updated
> > independently of user input. Think of something like `top`. I realized
> > that the process is using the same amount of CPU whether it is currently
> > visible or not. That bothers me. I would prefer if my app got notified
> > when its visibility changes so it can stop rendering (I think this is
> > called culling).
> >
> > For this to work it would need to be supported in several places:
> >
> > - Window managers could set _NET_WM_STATE_HIDDEN
> > - Terminal emulators and multiplexers could set the terminal size to 0,0
> > - Applications need to actually use that information
> >
> > The only project I could find that seems to do something like this is
> > mutter.
> >
> > So I am wondering: Is this even worth the effort? Have I missed any
> > prior art?
> >
> > thanks
> > tobias
> >
>
> Hi!
>
> htop, with a refresh rate of 1, uses of 1% of one the (3.40GHz) CPUs,
> I don't think this is a problem as people don't generally max out the
> CPUs. And I wouldn't think people have it running without being able
> to see it either. You would just be adding unneeded work and complexity
> for next to no gain. I would only think about this for intensive programs.
>
>
> Regards,
> Mattias Andrée

Hi again!

What you could do is to patch a terminal to allow programs to because
paused via SIGSTOP when invisible and continued via SIGCONT when
visible. Then your program would only need to write some string to
the terminal when it starts and when it terminates. Multiplexers
could however become an issue, but you could patch one as well.


Regards,
Mattias Andrée
Received on Sun Sep 06 2020 - 09:55:02 CEST

This archive was generated by hypermail 2.3.0 : Sun Sep 06 2020 - 10:36:07 CEST