Skip to content

Create a read-only variant of SparseHistogram with cumulative counts #119

@thinkingfish

Description

@thinkingfish

Sparse Histogram is generally more space-efficient in memory, but harder to update. This makes it an ideal format for read-only histograms.

Meanwhile, getting the value for a particular percentile is relatively expensive in the default histogram, due to the need to sum operation across buckets. However, storing cumulative counts (as summed from bucket 0) representation removes the need to compute any intermediary results—only comparison is needed. An implementation in JS is done by @yurivish in https://github.com/iopsystems/h2-histogram-js/blob/main/src/index.js#L298

Combining these two design choices—sparsity and accumulative counts—will yield a superior read-only histogram.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions