You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,11 +81,11 @@ The algorithm’s correctness is validated under the [C++11 memory model](https:
81
81
82
82
### NaN Support
83
83
84
-
The current implementation panics on `NaN`inputs to `Histogram::observe`, but it can be trivially supported by adding a `NaN` bucket after the `+Inf` bucket, ignored in collection results.
84
+
`NaN`values are supported via a dedicated `NaN` bucket placed after `+Inf`, removed from the collection result.
85
85
86
86
## Discussion
87
87
88
-
The Go implementation could be improved by using the `NaN` bucket trick presented above, and compute `_count` as the sum of non-`NaN`buckets. This eliminates the `_count` atomic, reducing observation to three atomic RMW — matching this algorithm.
88
+
The Go implementation could be improved by computing `_count` as the sum of all buckets (and using the `NaN`bucket trick presented above). This eliminates the `_count` atomic, reducing observation to three atomic RMW — matching this algorithm.
89
89
90
90
However, it lacks cache locality, which [benchmarks](benches/README.md) show has a significant impact under contention.
0 commit comments