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

Benchmark hybrid approach in Teds\unique_values, use if practical #192

Open
TysonAndre opened this issue Oct 22, 2022 · 0 comments
Open

Comments

@TysonAndre
Copy link
Owner

I've seen a hybrid approach in other implementations of methods to deduplicate values, since a hash table and sorting do worse than nested for loops in practice at very small sizes

  • For small n=count($input), use a regular foreach over buckets in the zend_array to be returned and call zend_is_identical one by one
  • For large n, use a hash table similar to the previous comment
@TysonAndre TysonAndre changed the title Benchmark hybrid approach in Teds\unique_values Benchmark hybrid approach in Teds\unique_values, use if practical Oct 22, 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

No branches or pull requests

1 participant