GNOME Bugzilla – Bug 728317
100% CPU load, when selecting category
Last modified: 2015-02-19 17:24:57 UTC
As soon as I select one of the journal categories in gnome-logs, such as "system", "security" or "application", CPU load shoots up to 100% and remains there. The programme becomes totally unresponsive and has to be killed (SIGTERM suffices)
As of 3.15.90, gnome-logs should be more responsive after selecting a category, because it now loads journal entries in an idle just before creating the widgets. However, it still creates all those widgets, so CPU time is still wasted. I'll attach some patches here that make it behave a bit more like infinite lists on the web -- only showing a few entries initially and loading more when you scroll to the bottom of the list. We probably won't need these anymore once we have GtkListView, which will be more clever about creating widgets. Logs still has to sift through everything on a search. We probably want to move filtering to GlJournalModel so that we don't have to create widgets which will be hidden anyway when filtering the listbox.
Created attachment 297254 [details] [review] journalmodel: only load one entry per idle Creating and layouting row widgets is too slow to do it five at a time.
Created attachment 297255 [details] [review] journalmodel: load entries in batches A major use case of gnome-logs is to open it to quickly see the most recent log entries. It doesn't make sense to read all available entries from disk and create row widgets for each of them. Thus, make GlJournalModel only load the first 50 entries and trigger it to load more once the user scrolls the listbox to the bottom. We still have to load all entries once a search is started.
Review of attachment 297254 [details] [review]: Looks fine.
Review of attachment 297255 [details] [review]: Also looks good. Thanks!
Attachment 297254 [details] pushed as 9a2dc04 - journalmodel: only load one entry per idle Attachment 297255 [details] pushed as 666d207 - journalmodel: load entries in batches