! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-notifyd is getting slower as notifications log gets bigger
Status:
RESOLVED: MOVED
Product:
Xfce4-notifyd
Component:
general

Comments

Description barteks2x 2018-11-10 16:31:48 CET
Overview: 
    xfce4-notifyd is reading the whole ~/.cache/xfce4/notifyd/log file every time it shows a notification.

Steps to Reproduce:
    1) Wait until your ~/.cache/xfce4/notifyd/log file gets very big, for example by sending a lot of notifications in a loop from a script (it reached over 20MB in my case)
    2) Run "notify-send Test" command

Actual Results: 
    It takes a noticeable fraction of a second to send a notification (0.2 seconds of more). Running xfce4-notifyd with strace shows that it's reading the whole ~/.cache/xfce4/notifyd/log file, which takes most of that time.

Expected Results: What the application should have done, were the bug not present.
    Sending notifications shouldn't get slower with bigger notification log.
Comment 1 Simon Steinbeiss editbugs 2018-11-10 23:47:58 CET
I guess you have the option enabled so that every notification is always logged?
In this case yes, the file is touched every time a notification comes in because the new notification needs to get added. It's possible that since I'm (ab)using rc files for this purpose that this slows things down as opposed to classical file interactions (like stupidly appending text).

Please test if performance is as normal if you disable the logging of notifications.
Comment 2 barteks2x 2018-11-11 00:57:29 CET
Yes, just disabling notification logging makes performance go back to normal. Initially I just renamed the file to get around this.
Comment 3 Jan Ziak (http://atom-symbol.net) 2020-05-06 19:46:30 CEST
I suggest to resolve this issue by using g_key_file_to_data() to store the single newly arrived notification and appending the data to the log file via write() or fwrite().
Comment 4 Simon Steinbeiss editbugs 2020-05-06 22:39:16 CEST
Sounds plausible. Feel free to propose a merge request on gitlab. (I just enabled your account)
Comment 5 Jan Ziak (http://atom-symbol.net) 2020-05-09 12:38:58 CEST
(In reply to Simon Steinbeiss from comment #4)
> Feel free to propose a merge request on gitlab. (I just enabled your account)

How is the transition to gitlab going? I added two notes to notifyd commits on gitlab, but I didn't see any info about to whom gitlab sent an e-mail notification. Did you receive those two notifications?
Comment 6 Simon Steinbeiss editbugs 2020-05-10 01:26:24 CEST
I didn't receive emails for your comments, but I noticed them in the activity tab. Not sure yet about the global notification scheme... I guess we still have to learn a bit about this new workflow, all of us (devs, contributors etc).
Comment 7 Git Bot editbugs 2020-05-24 20:06:14 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/xfce4-notifyd/-/issues/13.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #14865

Reported by:
barteks2x
Reported on: 2018-11-10
Last modified on: 2020-05-24

People

Assignee:
Simon Steinbeiss
CC List:
1 user

Version

Attachments

Additional information