From: Holger Hans Peter Freyther Date: Thu, 18 Jul 2013 12:45:12 +0000 (+0200) Subject: journal: Leave server_dispatch_message early when Storage is none X-Git-Tag: v206~41 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=2f5df74a5ec135ab2baebf26af6f088e5b4b8205 journal: Leave server_dispatch_message early when Storage is none When using Storage=none there is no point in collecting all the information just to throw them away. After this change journald consumes a lot less CPU time when only forwarding messages. --- diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 332ba4136..81de95966 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -845,6 +845,11 @@ void server_dispatch_message( if (LOG_PRI(priority) > s->max_level_store) return; + /* Stop early in case the information will not be stored + * in a journal. */ + if (s->storage == STORAGE_NONE) + return; + if (!ucred) goto finish;