Skip to content

perf: async .eml checksum, PROPFIND size reuse, E2EE parallel transfers#9995

Open
qoole wants to merge 1 commit into
nextcloud:masterfrom
qoole:perf/async-checksum-propfind-e2ee
Open

perf: async .eml checksum, PROPFIND size reuse, E2EE parallel transfers#9995
qoole wants to merge 1 commit into
nextcloud:masterfrom
qoole:perf/async-checksum-propfind-e2ee

Conversation

@qoole
Copy link
Copy Markdown
Contributor

@qoole qoole commented May 7, 2026

Summary

Three independent throughput improvements to discovery and propagation.

Async .eml checksum during discovery (discovery.cpp)

processFileAnalyzeLocalInfo computes a local checksum to detect false positives on .eml file change detection (issues #4754, #4755). The computation was synchronous and could block the discovery thread for seconds on large mailbox files.

Replaced with an async ComputeChecksum job. The result is captured into the existing finalize() lambda, so flow is preserved: if the computed checksum matches the database, the item is downgraded to UPDATE_METADATA; otherwise discovery continues normally. While the checksum runs, _pendingAsyncJobs keeps the discovery state machine alive and other work proceeds.

PROPFIND folder-size reuse (discoveryphase.cpp/.h, discovery.cpp)

checkSelectiveSyncNewFolder and checkSelectiveSyncExistingFolder were issuing a separate PropfindJob for each newly-encountered remote directory just to learn its size. The parent PROPFIND that produced serverEntry already has the folder size in RemoteInfo.sizeOfFolder.

Both functions now accept the size as a parameter and skip the redundant PROPFIND when it's already known. On a large remote tree this eliminates one HTTP round trip per directory.

E2EE FullParallelism (owncloudpropagator.cpp)

OwncloudPropagator::pushDirectoryToPropagateJob was forcing E2EE directories to WaitForFinished, which serialized all encrypted folder transfers globally — even folders on completely different paths. Within-folder ordering is already enforced by PropagateItemJob; the cross-folder serialization was a stronger guarantee than needed.

Allow E2EE directories to report FullParallelism. Encrypted folders on different paths can now transfer concurrently. Within-folder serialization is preserved.

Checklist

AI (if applicable)

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

- Make .eml checksum computation async during discovery to avoid
  blocking the event loop on large mailbox syncs. The previous
  synchronous computeLocalChecksum could pause discovery for several
  seconds on large .eml files; replaced with a ComputeChecksum job
  that defers the result via finalize().
- Reuse folder size from the PROPFIND response (RemoteInfo.sizeOfFolder)
  instead of issuing a redundant PropfindJob for selective sync size
  checks. The size is already available from the parent PROPFIND that
  populated serverEntry; an extra round trip per directory is wasteful.
- Allow E2EE directories to report FullParallelism so encrypted folders
  on different paths can transfer concurrently. Within-folder
  serialization is preserved by PropagateItemJob, so this only relaxes
  the cross-folder constraint that previously serialized all E2EE
  transfers globally.

Signed-off-by: Qoole <2862661+qoole@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant