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

Align usage of hashing functions #6136

Open
jpkrohling opened this issue Nov 4, 2021 · 17 comments
Open

Align usage of hashing functions #6136

jpkrohling opened this issue Nov 4, 2021 · 17 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed never stale Issues marked with this label will be never staled and automatically removed

Comments

@jpkrohling
Copy link
Member

Some parts of the code base are using custom-made hashing functions, others are using hash/fnv, while others are using other things. I believe we should unify that as much as possible, hopefully with hash/fnv as it's very performant and good enough for non-cryptographic usage.

@jpkrohling jpkrohling added the good first issue Good for newcomers label Nov 4, 2021
@VineethReddy02
Copy link

Looking into this! :)

@jpkrohling
Copy link
Member Author

There might be cases where it's OK to deviate from the standard, like for #5981. As @ydrozhdzhal mentioned:

I checked the fnv and it doesn't feet my needs, because it works with byte arrays and hashstructure can hash entire structure(you can find this in MR),

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2022

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Nov 7, 2022
@jpkrohling
Copy link
Member Author

@VineethReddy02, are you still interested in this?

@jpkrohling jpkrohling removed the Stale label Nov 29, 2022
@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@jpkrohling
Copy link
Member Author

This is again up for grabs.

@oertl
Copy link

oertl commented Jan 30, 2023

The project SMHasher compares various non-cryptographic hash functions in terms of speed and hash quality. The fastest hash functions without quality problems are listed here. FNV is not one of them.

@jmichalek132
Copy link
Contributor

Will try to find time to submit PR for this over the weekend.

@jpkrohling
Copy link
Member Author

@oertl, right now, we have some usage of fnv and I'd align on that first, given there should be only a few deviating usages. I am open to discussing changing the hashing algorithm to something else. Would you please open an issue with your arguments?

@oertl
Copy link

oertl commented Feb 7, 2023

@jpkrohling I am fine with them being aligned first. I just wanted to point out that there are better hash functions available in the meantime. The alignment may be the ideal moment to switch to a better hash function.

By the way, Go uses a variant of wyhash as its default hash function (see https://go.dev/src/runtime/hash64.go), which SMHasher lists among the recommended hash functions.

@jpkrohling
Copy link
Member Author

@oertl, I'd happily review a PR aligning the code base with a new hash function, especially if it's well-documented that it's a better fit for our use-cases (which seems to be the case!).

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Apr 10, 2023
@fatsheep9146
Copy link
Contributor

@jmichalek132 are you still working on this?

@fatsheep9146 fatsheep9146 added help wanted Extra attention is needed and removed Stale labels Apr 23, 2023
@jmichalek132
Copy link
Contributor

jmichalek132 commented Apr 24, 2023

Actually didn't get to it at all, unfortunately.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

  • issue: Github issue template generation code needs this to generate the corresponding labels.

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jun 26, 2023
@fatsheep9146 fatsheep9146 added never stale Issues marked with this label will be never staled and automatically removed and removed Stale labels Jul 4, 2023
@amritanshu-pandey
Copy link

I am keen to give it a try.

@atoulme
Copy link
Contributor

atoulme commented Nov 9, 2024

assigned to you @amritanshu-pandey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed never stale Issues marked with this label will be never staled and automatically removed
Projects
None yet
Development

No branches or pull requests

7 participants