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

Dict\unique_scalar() function to avoid performance penalty hit when using Dict\unique() on large scalar arrays #168

Merged
merged 17 commits into from Mar 25, 2021

Conversation

ghost
Copy link

@ghost ghost commented Mar 25, 2021

this avoids a rather large performance hit. (#167)

this avoids a rather large performance hit. (#167)
src/Psl/Dict/unique.php Outdated Show resolved Hide resolved
@azjezz azjezz self-assigned this Mar 25, 2021
@azjezz azjezz added Priority: High After critical issues are fixed, these should be dealt with before any further issues. Status: Revision Needed At least two people have seen issues in the PR that makes them uneasy. Type: Enhancement Most issues will probably ask for additions or changes. labels Mar 25, 2021
@azjezz
Copy link
Owner

azjezz commented Mar 25, 2021

Ah, this fails when values are not scalar ( which is something that we do support ) 🤔

how about we add a new function instead ( e.g: Dict\unique_scalar )?

pencil-dog and others added 4 commits March 25, 2021 08:53
@coveralls
Copy link

coveralls commented Mar 25, 2021

Pull Request Test Coverage Report for Build 686097315

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 685702919: 0.0%
Covered Lines: 2922
Relevant Lines: 2922

💛 - Coveralls

@ghost
Copy link
Author

ghost commented Mar 25, 2021

Gave it a try to unique_scalar().

Copy link
Owner

@azjezz azjezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few comments.

also, please regenerate the documentation using php docs/documentor.php

src/Psl/Dict/unique_scalar.php Outdated Show resolved Hide resolved
src/Psl/Dict/unique.php Outdated Show resolved Hide resolved
tests/Psl/Dict/UniqueScalarTest.php Outdated Show resolved Hide resolved
pencil-dog and others added 9 commits March 25, 2021 09:46
Co-authored-by: Saif Eddin Gmati <29315886+azjezz@users.noreply.github.com>
Co-authored-by: Saif Eddin Gmati <29315886+azjezz@users.noreply.github.com>
Co-authored-by: Saif Eddin Gmati <29315886+azjezz@users.noreply.github.com>
Co-authored-by: Saif Eddin Gmati <29315886+azjezz@users.noreply.github.com>
@ghost ghost changed the title use native function if parameter when appropriate Dict\unique_scalar() function to avoid performance penalty hit when using Dict\unique() on large scalar arrays Mar 25, 2021
@ghost
Copy link
Author

ghost commented Mar 25, 2021

Let me know if I can do anything else. I'll be rather busy until for a few hours, but I can come back to this later today or tomorrow. Thanks for all the feedback.

Copy link
Owner

@azjezz azjezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is perfect. thanks 👍

@azjezz azjezz merged commit dcb13b9 into azjezz:1.6.x Mar 25, 2021
@azjezz azjezz mentioned this pull request Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High After critical issues are fixed, these should be dealt with before any further issues. Status: Revision Needed At least two people have seen issues in the PR that makes them uneasy. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants