Skip to content

perf(logging): reduce logging overhead in hot paths#9990

Open
qoole wants to merge 1 commit intonextcloud:masterfrom
qoole:perf/logging-hot-paths
Open

perf(logging): reduce logging overhead in hot paths#9990
qoole wants to merge 1 commit intonextcloud:masterfrom
qoole:perf/logging-hot-paths

Conversation

@qoole
Copy link
Copy Markdown

@qoole qoole commented May 7, 2026

Summary

Reduces logging overhead in several frequently-hit code paths:

  • PUTFileJob::start(): removes a dead debug lambda that constructed a temporary QLoggingCategory on every upload progress tick. The progress signal is already connected to the proper handler on the next line, so the lambda was a no-op that ran on every chunk.
  • SyncJournalDb::setFileRecord: downgrades the 28-field log line from qCInfo to qCDebug so it no longer fires in production on every file record update. With large syncs this generates a substantial amount of log spam at info level.
  • Q_LOGGING_CATEGORY defaults: adds QtInfoMsg default to three category declarations that were missing it, preventing debug-level output from being active by default in those modules.
  • usermodel.cpp quota update: removes tr() and QString::number() allocations from a qCDebug call that runs on every quota refresh, even when debug logging is not enabled.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

- Remove dead debug lambda in PUTFileJob::start() that constructed a
  temporary QLoggingCategory on every upload progress tick. The signal
  is already connected to the proper handler on the next line.
- Downgrade setFileRecord's 28-field log from qCInfo to qCDebug so it
  no longer fires in production on every file record update.
- Add QtInfoMsg default to 3 Q_LOGGING_CATEGORY declarations that were
  missing it, preventing debug-level output from being active by default.
- Remove tr() and QString::number() allocations from a qCDebug call in
  usermodel.cpp quota update path.

Signed-off-by: Qoole <2862661+qoole@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant