Skip to main content

Module filter

Module filter 

Source
Expand description

Filtering of fixed-width values by a Selection.

filter_buffer filters values that are already in memory, and filter_chunked filters values that a ChunkDecoder decodes one chunk at a time. Both work for any T: Copy and share one strategy ladder. filter_records filters records whose byte width is known only at run time, and uses filter_buffer for power-of-two widths. The first matching row wins:

PrioritySelection or conditionOut-of-placeIn-place
1slicescopy runsmove runs
2indicesgather indicesmove indices
3bitmap, an eligible architecture kernelSIMD compressSIMD compress
4bitmap, density reaches the byte compress thresholdbyte compressbitmap walk
5bitmap, runs average at least 8 values and 96 bytescopy runsbitmap walk
6bitmap, otherwisebitmap walkbitmap walk

append_filtered appends to an existing buffer with the out-of-place column. Before row 3, it copies bitmap selections of values of at least 16 bytes at density >= 0.50 without branches.

Row 5 counts the runs of the first 256 words that have a set bit, unless the runs of the whole bitmap are already too many before then.

filter_buffer compacts in place only a uniquely owned buffer with density >= 0.50. filter_chunked applies the ladder to each chunk that it decodes, at the density of that chunk. SIMD eligibility is summarized in the simd module.

Structs§

Selection
The positions that a filter keeps, out of len positions.

Constants§

FILTER_CHUNK_LEN
Number of values in each chunk of a ChunkDecoder.

Traits§

ChunkDecoder
Decodes the values of an array in chunks of FILTER_CHUNK_LEN values, for filter_chunked.

Functions§

append_filtered
Appends the values of values that selection keeps to the end of out.
filter_buffer
Filters buffer by selection and returns the selected values.
filter_chunked
Filters the values of decoder by selection, and decodes only the chunks that hold selected values.
filter_records
Filters the records of width bytes in values by selection and returns the selected records.