[go: up one dir, main page]

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

Expose prelude helpers and bfuse struct fields #73

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ghost
Copy link
@ghost ghost commented Jun 1, 2023

What?

In order to allow developers to be more fine-grained with their usage of this crate, I am proposing simply pub placements that I am currently using to expose certain methods and fields necessary to compute the hash indices manually.

Why?

I found in benchmarking that I could significantly improve the lookup function in my code by only reading the initial metadata about the filter (seed and in the context of bfuse, segment information), computing the hash myself, and seek_reading the individual bytes from the file in which I am storing the built filters to determine if a key is contained within the filter. I am not knowledgeable enough with the filters themselves to be able to properly document the segment information or the prelude functions, so that may still be needed.

rusty-sediment and others added 3 commits May 31, 2023 20:35
Making prelude public allows other developers to gain access to methods such as `bfuse::hash_of_hash` and `HashSet::xor_from` in order to manually calculate the indices in a filter.
Copy link
Owner
@ayazhafiz ayazhafiz left a comment

Choose a reason for hiding this comment

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

I think this is reasonable, but let's make a few changes:

  • Let's not expose prelude publicly as prelude, but instead expose a module internal that exposes only certain functions that the prelude makes public (like, fingerprint!)

  • I would somewhat prefer that BinaryFuse8/16/32 expose a function attributes that returns the data on seed/segments rather than exposing it directly on the struct.

  • Let's do this for all filters, not just Fuse variants.

  • Would you be willing to add documentation on the exposed fields, and maybe a section in the library docs explaining the strategy you've used? It sounds like it might be valuable in general.

@ghost
Copy link
Author
ghost commented Jun 2, 2023

Let's not expose prelude publicly as prelude, but instead expose a module internal that exposes only certain functions that the prelude makes public (like, fingerprint!)

Sounds like a good idea.

I would somewhat prefer that BinaryFuse8/16/32 expose a function attributes that returns the data on seed/segments rather than exposing it directly on the struct.

So long as the function would return the exact same data, this would work!

Would you be willing to add documentation on the exposed fields, and maybe a section in the library docs explaining the strategy you've used? It sounds like it might be valuable in general.

I would if I knew better! Truthfully, I grasp enough conceptually about these types of filters to take advantage of them, but not enough to be able to explain what each field is.

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.

None yet

1 participant