Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slow performance with lots of notifications #134

Open
nekopsykose opened this issue Jun 24, 2022 · 9 comments · May be fixed by #288
Open

slow performance with lots of notifications #134

nekopsykose opened this issue Jun 24, 2022 · 9 comments · May be fixed by #288
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@nekopsykose
Copy link

nekopsykose commented Jun 24, 2022

this isn't really so much an "issue" as much as an avenue for optimisation.

generate a lot of notifications:

for x in $(seq 1 1000); do
  notify-send "$x" "$x"
done

as these fill the notification buffer, they get slower and slower to send (especially past the ~120 mark).

this itself doesn't really matter: nothing really spams notifications this much (at once). however, once they are all completed, opening the swaync center takes a long time of 2-3 seconds (swaync-client -t). once it's opened once, it then doesn't take very long to open/close (i assume the buffer is "cached" in some way), but any new notification coming in resets that long timer to open it once again.

clearing the notifications (open center, Shift+c or whatnot), then resets back to the fresh behaviour of everything being fast.

this doesn't really matter, but it makes it a little slow to open the notification center to check recent notifications once the buffer is somewhere above ~120 notifications. and this is very common if one doesn't ever clear them, like me, being too lazy to click them away and letting them pile up for a while.

of course the easiest fix is actually dismissing notifications all the time, but i think there might also be some way to make it not slow to open with 100+ notifications, maybe there is some very obvious place to optimise the notification buffer being toggled.

@ErikReider ErikReider added bug Something isn't working help wanted Extra attention is needed labels Jun 24, 2022
@ErikReider
Copy link
Owner

Hmmm... I wonder if all notifications need to be drawn before opening even if they're not visible?

@ErikReider
Copy link
Owner

Seems like a GTK issue...

@kennylevinsen
Copy link

Inefficient lists is one of the things fixed by Gtk4, with its recycling GtkListView.

@ErikReider
Copy link
Owner

Inefficient lists is one of the things fixed by Gtk4, with its recycling GtkListView.

Cool! Didn't know that! I'll be porting this to GTK4 once gtk4-layer-shell becomes available in distro repos :)

@nekopsykose
Copy link
Author

I'll be porting this to GTK4 once gtk4-layer-shell becomes available in distro repos

distros usually add deps for things that use them, i.e. they would add gtk4-layer-shell to satisfy this if you ported to it. that's why almost no distro has it already- no application uses it (that i know of), and it's not hard to build. someone has to be the first (usually). don't let that stop you in itself :) (speaking as a distro maintainer)

of course, it's a bunch of more work to actually do the porting, so no rush there :)

@ErikReider
Copy link
Owner

Things have slowed down a bit in SwayFX now when blur has been merged so I'll probably look into this after #221 is merged

@ErikReider ErikReider added this to the v1.0.0 milestone May 29, 2023
@0xC0ncord
Copy link

I think a decent workaround would be to have a configurable "buffer" size for notifications, e.g. a max-notification-count option set to 100 will cause old notifications to be automatically dismissed once that number of notifications is reached.

@ErikReider ErikReider linked a pull request Jun 27, 2023 that will close this issue
6 tasks
@emanuelserpa
Copy link

Agreed @0xC0ncord, an optional buffer would be good, because I always forgot to clear and when I clear it the swaync just freezes because it is too many notifications.

@ErikReider ErikReider modified the milestones: v1.0.0, v1.1.0 Dec 14, 2023
@s0ulslack
Copy link

I use this with my security system, I avg 200-500 notifications every 24hr. When I first start swaync its using ~60mb, 2 days running its using ~400mb, after 4 days its over 1gb. I clear notifications several times a day, is this normal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants