After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728317 - 100% CPU load, when selecting category
100% CPU load, when selecting category
Status: RESOLVED FIXED
Product: gnome-logs
Classification: Other
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-logs maintainer(s)
gnome-logs maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-04-16 07:17 UTC by Johannes Rohr
Modified: 2015-02-19 17:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
journalmodel: only load one entry per idle (1.73 KB, patch)
2015-02-19 10:31 UTC, Lars Karlitski
committed Details | Review
journalmodel: load entries in batches (6.45 KB, patch)
2015-02-19 10:31 UTC, Lars Karlitski
committed Details | Review

Description Johannes Rohr 2014-04-16 07:17:39 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)
Comment 1 Lars Karlitski 2015-02-19 10:30:49 UTC
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.
Comment 2 Lars Karlitski 2015-02-19 10:31:23 UTC
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.
Comment 3 Lars Karlitski 2015-02-19 10:31:35 UTC
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.
Comment 4 David King 2015-02-19 11:43:11 UTC
Review of attachment 297254 [details] [review]:

Looks fine.
Comment 5 David King 2015-02-19 11:44:39 UTC
Review of attachment 297255 [details] [review]:

Also looks good. Thanks!
Comment 6 Lars Karlitski 2015-02-19 17:24:49 UTC
Attachment 297254 [details] pushed as 9a2dc04 - journalmodel: only load one entry per idle
Attachment 297255 [details] pushed as 666d207 - journalmodel: load entries in batches