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

Use serde_bytes to reduce (de)serilization speed of 8-bit filters by 96% #81

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

Conversation

JanBerktold
Copy link

@JanBerktold JanBerktold commented Nov 18, 2023

I noticed that deserialization of the BinaryFuse8 using serde takes a long time. In my use case with 450 millions members, it takes 2-3 minutes on a modern machine. The majority of this time is spent on the byte-by-byte deserialization of the fingerprints slice. The specialization offered by the serde_bytes crate solves that exact problem.

I also added a benchmark to show the difference and posted the results from a run on an M2 MacBook below.

Before:

BinaryFuse8/serialize/500000
                        time:   [263.42 µs 269.47 µs 272.86 µs]
BinaryFuse8/deserialize/500000
                        time:   [1.2453 ms 1.2498 ms 1.2553 ms]

After:

BinaryFuse8/serialize/500000
                        time:   [9.4238 µs 9.4404 µs 9.4479 µs]
                        change: [-96.524% -96.466% -96.401%] (p = 0.00 < 0.05)
                        Performance has improved.
BinaryFuse8/deserialize/500000
                        time:   [14.670 µs 14.727 µs 14.801 µs]
                        change: [-98.822% -98.816% -98.809%] (p = 0.00 < 0.05)
                        Performance has improved

@JanBerktold JanBerktold changed the title Use serde_bytes to optimize (de)serilization speed of 8-bit filters Use serde_bytes to reduce (de)serilization speed of 8-bit filters by 96% Nov 18, 2023
@JanBerktold JanBerktold marked this pull request as ready for review November 19, 2023 01:46
@JanBerktold
Copy link
Author

Hi @ayazhafiz, could you take a look at this one please?

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.

Thank you! Sorry for the delay.

@ayazhafiz
Copy link
Owner

Do you mind pushing an empty commit? I don't see a way to retry the CI. I think it's a flake.

@JanBerktold
Copy link
Author

Sure thing -- done.

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

2 participants