-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce DecodeFrom and EncodeReader
The buckets byte slice is the biggest part of the the memory used by the filter, and might be several of GBs. Common usage of a filter is in an environment with limited RAM size based on the filter size, load it to memory on startup and dump it to disk on teardown. Currently the Encode and Decode methods duplicates the byte slice, which makes the memory usage at the loading and dumping time to be (at least) twice the filter size. This commit introduces a new method for dumping the filter using a reader of the internal byte slice, and a method for loading the filter based on already fetched encoded bytes (from disk, network) and use them internaly instead of making a copy. + formatting.
- Loading branch information
Showing
5 changed files
with
207 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.