Skip to content

Commit

Permalink
Fix a potential precision loss on integer in ReservoirCellIndexFor (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Oct 18, 2022
1 parent 7f37bc3 commit d9f8bce
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ class HistogramExemplarReservoir : public FixedSizeExemplarReservoir
const MetricAttributes & /* attributes */,
const opentelemetry::context::Context & /* context */) override
{
int max_size = boundaries_.size();
for (int i = 0; i < max_size; ++i)
size_t max_size = boundaries_.size();
for (size_t i = 0; i < max_size; ++i)
{
if (value <= boundaries_[i])
{
return i;
return static_cast<int>(i);
}
}
return -1;
Expand Down

2 comments on commit d9f8bce

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: d9f8bce Previous: 7f37bc3 Ratio
BM_BaselineBuffer/1 2521140.3369903564 ns/iter 513972.7592468262 ns/iter 4.91
BM_LockFreeBuffer/2 9095788.00201416 ns/iter 1467164.9932861328 ns/iter 6.20

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: d9f8bce Previous: 7f37bc3 Ratio
BM_SpinLockThrashing/2/process_time/real_time 0.7286329527158995 ms/iter 0.21188850689651376 ms/iter 3.44
BM_ProcYieldSpinLockThrashing/2/process_time/real_time 2.0268659333924988 ms/iter 0.24424502343842477 ms/iter 8.30

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.