Skip to content

perf(preview): cache the hardware concurrency - #65145

Open
CarlSchwan wants to merge 1 commit into
masterfrom
carl/preview-concurrency-cache
Open

CarlSchwan wants to merge 1 commit into
masterfrom
carl/preview-concurrency-cache

Conversation

@CarlSchwan

Copy link
Copy Markdown
Member

Summary

Every preview request reads /proc/cpuinfo twice to compute the default preview concurrency. The kernel generates that file on each read, which costs as much as looking up a cached preview. Cache the value in the local cache instead.

Save: 3.7% of a cached-preview request in the profile

Checklist

AI (if applicable)

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

@CarlSchwan CarlSchwan added this to the Nextcloud 36 milestone Oct 5, 2026
@CarlSchwan CarlSchwan self-assigned this Oct 5, 2026
@CarlSchwan
CarlSchwan requested a review from a team as a code owner October 5, 2026 14:55
@CarlSchwan
CarlSchwan requested review from Altahrim, icewind1991, leftybournes and salmart-dev and removed request for a team October 5, 2026 14:55
Every preview request reads /proc/cpuinfo twice to compute the default
preview concurrency. The kernel generates that file on each read, which
costs as much as looking up a cached preview. Cache the value in the
local cache instead.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@CarlSchwan
CarlSchwan force-pushed the carl/preview-concurrency-cache branch from c8ee7ac to 9814868 Compare October 5, 2026 17:49

This branch has not been deployed

No deployments
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.

4 participants