MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / histogram_simple

Function histogram_simple

src/histogram.rs:9–15  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

7}
8
9fn histogram_simple(bytes: &[u8]) -> [usize; 256] {
10 let mut histogram = [0; 256];
11 for &v in bytes {
12 histogram[v as usize] += 1;
13 }
14 histogram
15}
16
17fn histogram_parallel(bytes: &[u8]) -> [usize; 256] {
18 // Summing multiple 32 bit histograms is faster than a 64 bit histogram.

Callers 2

histogramFunction · 0.85
bench_histogram_simpleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected