RedisBloom / t-digest-c

Wicked Fast, Accurate Quantiles Using 'T-Digests'
Other
15 stars 4 forks source link

Added td_quantiles() API #24

Closed filipecosta90 closed 2 years ago

filipecosta90 commented 2 years ago

This new API td_quantiles implies a 7% reduction of the total CPU cycles to calculate a set of 4 quantiles that we normally use for monitoring.

Fixes #17

build/tests/histogram_benchmark  --benchmark_min_time=10 --benchmark_filter="BM_td_quantile_lognormal_dist_given_array*|BM_td_quantiles_*"
2022-05-20T16:09:43+00:00
Running build/tests/histogram_benchmark
Run on (20 X 913.345 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x20)
  L1 Instruction 32 KiB (x20)
  L2 Unified 1024 KiB (x20)
  L3 Unified 28160 KiB (x1)
Load Average: 0.32, 0.10, 0.02
------------------------------------------------------------------------------------------------------------------
Benchmark                                                        Time             CPU   Iterations UserCounters...
------------------------------------------------------------------------------------------------------------------
BM_td_quantile_lognormal_dist_given_array/100/10000000        92.0 ns         92.0 ns    151836516 Centroid_Count=70 Total_Compressions=18.461k items_per_second=715.78k/s
BM_td_quantile_lognormal_dist_given_array/200/10000000        92.1 ns         92.1 ns    152326099 Centroid_Count=115 Total_Compressions=9.131k items_per_second=712.997k/s
BM_td_quantile_lognormal_dist_given_array/300/10000000        92.1 ns         92.1 ns    152056453 Centroid_Count=163 Total_Compressions=6.066k items_per_second=714.23k/s
BM_td_quantile_lognormal_dist_given_array/400/10000000        92.1 ns         92.0 ns    152101891 Centroid_Count=210 Total_Compressions=4.535k items_per_second=714.237k/s
BM_td_quantile_lognormal_dist_given_array/500/10000000        92.1 ns         92.1 ns    151949891 Centroid_Count=248 Total_Compressions=3.618k items_per_second=714.726k/s
BM_td_quantiles_lognormal_dist_given_array/100/10000000       85.5 ns         85.4 ns    164029880 Centroid_Count=70 Total_Compressions=18.461k items_per_second=713.47k/s
BM_td_quantiles_lognormal_dist_given_array/200/10000000       85.3 ns         85.3 ns    164011596 Centroid_Count=115 Total_Compressions=9.131k items_per_second=714.423k/s
BM_td_quantiles_lognormal_dist_given_array/300/10000000       85.3 ns         85.3 ns    164121590 Centroid_Count=163 Total_Compressions=6.066k items_per_second=713.966k/s
BM_td_quantiles_lognormal_dist_given_array/400/10000000       85.4 ns         85.4 ns    164214797 Centroid_Count=210 Total_Compressions=4.535k items_per_second=713.202k/s
BM_td_quantiles_lognormal_dist_given_array/500/10000000       85.4 ns         85.4 ns    163643996 Centroid_Count=248 Total_Compressions=3.618k items_per_second=715.744k/s
codecov[bot] commented 2 years ago

Codecov Report

Merging #24 (f6dd0fd) into master (0109bd1) will increase coverage by 1.22%. The diff coverage is 98.03%.

@@            Coverage Diff             @@
##           master      #24      +/-   ##
==========================================
+ Coverage   86.71%   87.93%   +1.22%     
==========================================
  Files           1        1              
  Lines         286      315      +29     
==========================================
+ Hits          248      277      +29     
  Misses         38       38              
Impacted Files Coverage Δ
src/tdigest.c 87.93% <98.03%> (+1.22%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0109bd1...f6dd0fd. Read the comment docs.