Skip to content

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

Open
qoole wants to merge 1 commit intonextcloud: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 intonextcloud:masterfrom
qoole:perf/async-checksum-propfind-e2ee

Conversation

@qoole
Copy link
Copy Markdown

@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>
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