Skip to content

Navigation Menu

Sign in
Sign up

perf: Speed up fetching services from container - #64172

Draft
come-nc wants to merge 7 commits into
fix/cleanup-server-container from
perf/short-circuit-aliases
Draft

perf: Speed up fetching services from container #64172
come-nc wants to merge 7 commits into
fix/cleanup-server-container from
perf/short-circuit-aliases

Conversation

@come-nc

@come-nc come-nc commented Sep 10, 2026
edited
Loading

Copy link
Copy Markdown
Contributor
  • Resolves: #

Summary

Speed containers lookup by:

  • Storing aliases in a raw array instead of relying on a closure in the container
  • Removed useless checks
  • Avoid relying on an exception throwing for a common usecase

Checklist

AI (if applicable)

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

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc self-assigned this Sep 10, 2026
@come-nc come-nc added the 2. developing Work in progress label Sep 10, 2026
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
$this->has will almost always return true as it checks class_exists and
 also $this->server->has, so the if made no sense.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Building an exception object can be expensive, avoid building one only
 to fallback to server DI from applications.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc added this to the Nextcloud 36 milestone Sep 10, 2026
@come-nc come-nc changed the title (削除) fix: Short-circuit aliases to avoid querying container for this (削除ここまで) (追記) perf: Speed up fetching services from container (追記ここまで) Sep 10, 2026
come-nc added this pull request to stack #64192 September 10, 2026 15:09
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

come-nc commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

I think the flat array for aliases cannot work, at least not how I implemented it here.
Each container (one for server and one per application) may have its own aliases.
So the alias should be resolved at the last minute, before calling pimple container, never earlier. I’ll have to see if this can be done without too much trouble.
The rest of the changes are not impacted I believe.

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

Reviewers

@CarlSchwan CarlSchwan CarlSchwan approved these changes

At least 2 approving reviews are required to merge this pull request.

Labels

Projects

None yet

Milestone

Nextcloud 36

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /