Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defer instantiation for memoizable array items (Craft 4) #14104

Merged
merged 12 commits into from
Jan 4, 2024

Conversation

brandonkelly
Copy link
Member

Description

Adds a new $normalizer argument to craft\base\MemoizableArray’s constructor, which can be used to lazy-instantiate any items within it, once they’re actually requested by all() or firstWhere().

We’re now taking advantage of this everywhere we can, as an initial measure to reducing the number of things that need to get instantiated in any given request.

Related issues

@brandonkelly brandonkelly changed the title Defer instantiation for memoizable array items Defer instantiation for memoizable array items (Craft 4) Jan 4, 2024
@brandonkelly brandonkelly merged commit ca6efc8 into 4.6 Jan 4, 2024
@brandonkelly brandonkelly deleted the feature/defer-instantiation-v4 branch January 4, 2024 12:31
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