Skip to content

[9.x] Optimize Collection::containsStrict - #44970

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
tyabu12:optimize-contains-strict
Nov 16, 2022
Merged

[9.x] Optimize Collection::containsStrict#44970
taylorotwell merged 1 commit into
laravel:9.xfrom
tyabu12:optimize-contains-strict

Conversation

@tyabu12

@tyabu12 tyabu12 commented Nov 16, 2022

Copy link
Copy Markdown
Contributor

This PR increase the speed of Collection::containsStrict by using in_array (strict) .

The execution speed is increased by a factor between 2 and 10.
Here is the benchmark.
https://3v4l.org/UCqoe

@taylorotwell
taylorotwell merged commit 9a6419c into laravel:9.x Nov 16, 2022
@tyabu12
tyabu12 deleted the optimize-contains-strict branch November 16, 2022 23:40
@tyabu12 tyabu12 changed the title Optimize Collection::containsStrict [9.x] Optimize Collection::containsStrict Nov 18, 2022
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.

2 participants